[Resolved]Begin position of moving object to low

  • #1, by wimfWednesday, 14. February, 19:34 10 months ago
    I understood the formula to calculate the position of the object. I take the position of the object to move, then I deduce the position of the destination.

    The object moves well and arrives at its destination, but the movement of the object begins at a different position than its starting position.

    I do not understand why he starts too low.

    Object position: x = 1050 y = 875

    Code:

    Move object "velobengaucheruetatiere" to (-328, -624)
    1



    He arrives exactly at the destination I calculated for him, but he starts much lower

    Thank you for your help

    Forum Fan

    237 Posts


  • #2, by wimfWednesday, 14. February, 20:39 10 months ago
    I have tested with script of AFRLme

    function moveObj(obj, x, y, delay, easing)
    obj = game.CurrentScene.SceneObjects[obj]
    -- + --
    obj:to(delay, { ObjectOffset = {x = (obj.ObjectPosition.x - x) * -1, y = (obj.ObjectPosition.y - y) * -1} }, easing)
    end


    moveObj("velobengaucheruetatiere", 715, 250, 5000, easeQuintOut)
    1
    2
    3
    4
    5
    6
    7
    8



    Destination working , but start position to low roll

    Forum Fan

    237 Posts

  • #3, by wimfFriday, 16. February, 10:28 10 months ago
    Hi

    I have tested other thing :

    Move object
    X and Y, for positionning the start objet
    and after the function Move object to

    But this problem is same.

    I created a new test project and the problem is the same ...

    Could you help me smile thank you

    Forum Fan

    237 Posts

  • #4, by esmeraldaFriday, 16. February, 11:07 10 months ago
    I'm not sure I understand what you are meaning.
    But have you tried using the actionparts "move object to" (absolute position) or "move object" (relative position) instead of a script? It worked fine for me.

    You should keep in mind, that the positon of the object in a scene is defined by the upper left corner of your image. 

    Great Poster

    304 Posts

  • #5, by wimfFriday, 16. February, 11:14 10 months ago
    Yes, I tested that too. It works for the destination, but it does not start in the right place, it's strange.

    Yes, I have defined the position of the object at the upper left corner...

    Thank

    Forum Fan

    237 Posts

  • #6, by esmeraldaFriday, 16. February, 11:26 10 months ago
    Do I understand this correctly: the image of your object jumps to a different (lower) position when it starts moving?
    It does this even when using the action parts? Very strange indeed. Sorry - no clue...

    Great Poster

    304 Posts

  • #7, by stothewFriday, 16. February, 15:48 10 months ago
    Did you move the object before?
    if yes, the new position becomes the new 0,0 coordinates.
    Just be be sure you keep that in mind. smile

    Forum Fan

    118 Posts

  • #8, by wimfFriday, 16. February, 16:37 10 months ago
    HI smile

    Yes, i know, but problem is same

    even stranger, if I make a move object on a value X but that I put Y at "0", it should advance in a straight line because the Y = 0, but still it is strange, it moves to the top left corner of the screen

    I'm starting to think it's a VS bug

    Forum Fan

    237 Posts

  • #9, by stothewFriday, 16. February, 16:48 10 months ago
    have you tried to totally reset the offset before moving?

    Scenes.SCENE_NAME.Objects.OBJECT_NAME.ObjectOffset = {x=0, y=0}
    1

    and move it e.g. like this?

    moveObj(Scenes.SCENE_NAME.Objects.OBJECT_NAME, -100, 0, 5000, 30)
    1

    Forum Fan

    118 Posts

  • #10, by wimfFriday, 16. February, 18:01 10 months ago
    Thanks for your help. I just tested, but I have the same problem.

    I think I will do otherwise, I will create png animations where is my objet move. I will save time, I think.

    Forum Fan

    237 Posts

  • #11, by wimfSaturday, 03. March, 09:48 10 months ago
    I finished my scene with my movement of objects. I did it in PNG and compressed into webp, so it works really well and does not take a lot of resources. I rename the subject in 'resolved' (although I did not find the solution directly, I have the result that I wanted to have.)

    smile

    Thank you all

    Forum Fan

    237 Posts

Write post