Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Point towards in variables
- sambothegreat
-
Scratcher
2 posts
Point towards in variables
Hey im trying to make a variable that saves a block with “Point towards X Y”
ik that this exists but after some testing i discovered that point towards dosnt work the same as storing the value in a variable
https://imagizer.imageshack.com/img923/8469/KX8vge.png
i cant just point towards and save direction because thats an extra move command (im trying to be as lag efficient as i can, i need to be. trust me)
ik that this exists but after some testing i discovered that point towards dosnt work the same as storing the value in a variable
https://imagizer.imageshack.com/img923/8469/KX8vge.png
i cant just point towards and save direction because thats an extra move command (im trying to be as lag efficient as i can, i need to be. trust me)
- Pixilized
-
Scratcher
100+ posts
Point towards in variables
You actually can do what you are saying. Even though storing that value to a variable seems to not be a valid direction, having the sprite point in the direction of the variable will still work, as scratch will automatically convert the value to a scratch friendly direction when pointing.
- sambothegreat
-
Scratcher
2 posts
Point towards in variables
You actually can do what you are saying. Even though storing that value to a variable seems to not be a valid direction, having the sprite point in the direction of the variable will still work, as scratch will automatically convert the value to a scratch friendly direction when pointing.
i wasnt very clear in my original text, but i did say i didnt want to do what you just mentioned. But i figured out how to convert the variable into a direction on my own. (after staring at a screen for like 3 hours i realized how radians work. Im really stupid, its as simple as if the variable is greater than 180, set it to variable - 360.) still thank you. appreciate the effort.
Last edited by sambothegreat (Oct. 24, 2023 20:31:44)
- Pixilized
-
Scratcher
100+ posts
Point towards in variables
Oh, okay. I though you wanted to save a value to point to later. I'm glad you solved your problem!
- Discussion Forums
- » Help with Scripts
-
» Point towards in variables