User Tag List

Results 1 to 3 of 3

Thread: Move straight from one point to the next?

  1. #1
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    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.



    Thanks in advance!

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,320
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    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

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    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? :/

Similar Threads

  1. Replies: 9
    Last Post: 31st January 2013, 06:42 AM
  2. How would you move an object in straight line pixel by pixel from location to another
    By Tsun in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 22nd December 2012, 11:38 PM
  3. move around point towards object
    By Bigfoot in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 9th July 2010, 10:12 AM
  4. Coordinates +1 movement, move to specifies point
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 22nd December 2009, 12:16 PM

Posting Permissions

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