User Tag List

Results 1 to 2 of 2

Thread: How to stop just the x or y of an object?

  1. #1


    Join Date
    May 2010
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to stop just the x or y of an object?

    I am wondering how to apple a stop command to just the x or the y portions of an objects movement. Like if it's moving at an angle just stop it's x and it falls down or just it's y and it goes left, keeping speed of course. Would I have to split the vector of the object, store the part I wanted to save and the stop it altogether and give it the speed at a certain direction?

  2. #2
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: How to stop just the x or y of an object?

    You can use either method.
    If you really like to keep it all in direction/speed terms then you can mathematically change the direction and speed to do what you want. I would probably use the separated x and y movement, but it might not be that easy in your case?

    Do to it you would kinda have to split it up into x and y movement values and then go back to direction/speed again afterwards.

    I made a tiny little example where it calculates the new speed of the object after setting the x-speed to 0 (changes it's direction to down):
    http://andersriggelsen.dk/uploads/x-y-split.mfa
    As you can see, the object moving left will stop completely on impact while the others will keep a bit of their momentum as they were already moving a bit downwards.
    To set the y-speed to 0, then use cos() instead of sin()

Similar Threads

  1. How to make an object fall on another instance of the object and stop?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 20th June 2013, 09:42 PM
  2. Can't stop a launched object.
    By LemonyLime in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th October 2012, 04:59 PM
  3. How to stop an object shot temporary?
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 20th February 2009, 05:28 PM
  4. Is there a way to stop the pop up object from...
    By ClickerGuy in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 21st December 2008, 08:47 AM
  5. How do I make an object stop in collision?
    By keokeo in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th December 2006, 04:57 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
  •