Send Object To Position

  • #1, by davide-finSunday, 14. January, 15:22 3 months ago
    Hi all, I think I have found a bug.
    I need to move an object in a scene an I see that I could use 2 different action parts: "Move object" and "Move object to".

    I use "Move object" to move an item of X pixels orizontally and / or Y pixels vertically.
    Instead, given the name, I think that "Move object to" should animate my item to position specified by X and Y coordinates.

    It seems to me that the two action parts actually behave in the same way and my object is always moved by only X pixels orizontally and Y pixels vertically.

    Newbie

    5 Posts


  • #2, by afrlmeSunday, 14. January, 23:27 3 months ago
    They are both based on offset.

    Move Object should offset the object sprite/animation from the default position you placed it in the scene by the amount you specify.

    Move Object To should offset the object to the absolute coordinates you specify.

    Quick note: you need to understand that the offset for both is based on the object center value coordinate you specified & not the top left pixel of the sprite/animation.

    It's much easier to move animations about than objects & I would recommend doing that, unless it's an object the player can interact with.

    ActiveAnimations["example"]:to(1000, { CurrentPosition = {x = 100, y = 100} })



    Imperator

    7278 Posts

  • #3, by esmeraldaTuesday, 16. January, 09:30 3 months ago
    Yeah, it is quite annoying that the movement of the object is based on the offset. That can give you a headache...

    In case you are not comfortable with using script as AFRLme suggested, there are custom action parts you can add to your project as plugins.
    There is one for moving animations and another one for moving objects to an absolute postion (done with a bit of math to calculate the absolute position based on the position of the image).

    Key Killer

    514 Posts

Write post