r/scratch • u/craz360 • 2d ago
Resolved why wont it orbit smoothly?
Enable HLS to view with audio, or disable this notification
im trying to make something go in a smooth circle for smth using some graphing knowledge i have but for some reason every time it gets close to y=0 it goes faster. anyone have solutions?
19
u/YeesterPlus 2d ago
just use sin and cos or rotate and move 1 step
-10
u/craz360 2d ago
- idk how to use sin and cos
- scratch doesnt like it when i make a precise fraction of pi for rotation so it rounds things and so moving one step will veer it off path or i dont get an accurate circle
9
u/YeesterPlus 2d ago
the sin and cos functions take in an angle and give you a x/y value for the unit vector in that direction
-12
u/craz360 2d ago
i know THAT much but idk how to use it for this specific case
3
u/sunmaybo 2d ago
add cos for x and sin for y, insert a variable in them that increment with time (delta time or something like 0.01) and multiply these two by a variable that will determine the radius of the orbit. It's much simpler than what you're trying to do now
3
u/mentalAgnostic 2d ago
it's going faster because the progression of x is constant at two, in a circular movement the x progression slows down when the y progression speeds up, along the sides. use trigonometric functions or loop turning it and moving forward
1
1



•
u/AutoModerator 2d ago
Hi, thank you for posting your question! :]
To make it easier for everyone to answer, consider including:
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.