User Tag List

Results 1 to 3 of 3

Thread: Get moving amounts of pixels and move another object by it

  1. #1
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)
    ASD's Avatar
    Join Date
    Feb 2007
    Location
    Japan
    Posts
    1,764
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Question Get moving amounts of pixels and move another object by it

    I made this example. get to the moving amounts of the obeject and move another object by it.
    However, the second object will warp when position of the original object looping.
    I don't want warp the second object (it should be go straight).

    Does anyone know any idea?
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 Developer
    PBarwick's Avatar
    Join Date
    Jul 2014
    Posts
    390
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I can't look at your example right now, but I imagine it can be achieved by changing your position calculation from something like:

    Set X position of object2 to: X(object1) +6

    to something like:

    Set X position of object2 to: (X(object1) +6) mod FrameWidth

    Do another "mod FrameHeight" for your Y direction movement.

    The mod function returns the remainder after dividing by the number written after it, so:

    340 mod 300 = 40

    You might need to add an offset to take into account where the hotspot of your object is.

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    643
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Hi ASD.

    You're using the difference between your first object's new and old position in a value to move the second object. Doing this will cause the second object to match the position of the first object exactly without any modifications, since when you teleport your first object to the top of the screen, the old position stays at the bottom, causing the difference to be both negative and really large: this warps your second object right up there with it.

    Something simple you can try is to subtract the amount you moved the first object from your difference value whenever you teleport. Go to Line 1 in your example, and add this:
    ASD help.png
    It should work the way you want it to.

    get_object_moving_pixels_2.mfa

Similar Threads

  1. moving objects don't move separately
    By Gabriel_V in forum Fusion 2.5
    Replies: 3
    Last Post: 16th January 2016, 12:00 AM
  2. Move object to moving touch position?
    By gagegage926 in forum Fusion 2.5
    Replies: 3
    Last Post: 14th March 2015, 01:48 AM
  3. Move player while he's on a moving platform?
    By BartekB in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 19th November 2013, 04:25 PM
  4. Moving actives cut out pixels
    By SuperDisk in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 8th February 2013, 09:33 PM
  5. Always - move object Y-1 is to slow, and always - move object Y-2 is to fast. help
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 9th February 2012, 12:56 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
  •