We are about to switch to a new forum software. Until then we have removed the registration on this forum.
How do I make an object go straight in a direction, like Unity.vector2?
You could use a PVector instance.
PVector
You could keep track of the x and y values yourself.
You could store a direction and a speed, and then calculate the movement using the cos() and sin() functions.
cos()
sin()
Please try something, consult the reference and some tutorials, and post if you get stuck. Good luck.
Answers
You could use a
PVector
instance.You could keep track of the x and y values yourself.
You could store a direction and a speed, and then calculate the movement using the
cos()
andsin()
functions.Please try something, consult the reference and some tutorials, and post if you get stuck. Good luck.