Send Object To Position

  • #1, z davide-finSunday, 14. January, 15:22 hodinky 8 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.

    Bažant

    7 Posts


  • #2, z afrlmeSunday, 14. January, 23:27 hodinky 8 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} })



    Imperátor

    7285 Posts

  • #3, z esmeraldaTuesday, 16. January, 09:30 hodinky 8 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).

    Zabiják klíčů

    525 Posts

Napsat příspěvek