Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to make character move only in two direction?

Asked by
Tiranin 45
10 years ago

Rather than character moving in all three axis, I want him to move only in two: up-down and right-left.

I do know how to do that with BodyPosition, but to spice things up, I wanna change the angle in which character can move. That means if he can move left-right, I want him to move bit forward-backward.

If you can't make sense of what I am saying, try to imagine coordinate system with X and Y axis. That will be the "bird view" of character moving. There, X axis would be character moving with normal BodyPosition.maxForce(0,0,500000). Now imagine a line that goes 30° relative to X axis. My question is, how do I make character move on that 30° line?

0
Thank you for blowing my mind today with this code theory. OniiCh_n 410 — 10y
1
No problem. Tiranin 45 — 10y

1 answer

Log in to vote
-1
Answered by 10 years ago

are you trying to make a 2d game?

Ad

Answer this question