 # Thread: Move straight from one point to the next?

1. ## Move straight from one point to the next?

So I know how to do the typical movement where an object moves toward a point by moving the x/y positions if they are < or > than the end positions... But the problem is that it gives me stuff like the red path in my example.

I want a formula/method that will give me the blue path... a nice straight path to the point no matter what. I'm pretty terrible with math, so after an hour of attempts, I'm hoping someone here can help me out. It's probably pretty straightforward but like I said, I'm bad with math.    Reply With Quote

2. It's just a standard 360 degree movement:

angle = ATan2(start_y - end_y, end_x - start_x)
xpos = xpos + (Cos(angle) * velocity)
ypos = ypos - (Sin(angle) * velocity)
X position = xpos
Y position = ypos  Reply With Quote

3. Hrmmm even with this formula I'm still getting the same issue... It's just a slightly different angle now. Could you possibly make an example of this in action? :/  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•