[Resolved]Begin position of moving object to low

  • #1, by wimfWednesday, 14. February 2018, 19:34 6 years 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)



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

    Thank you for your help

    Forum Fan

    238 Posts


  • #2, by wimfWednesday, 14. February 2018, 20:39 6 years 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)



    Destination working , but start position to low roll

    Forum Fan

    238 Posts

  • #3, by wimfFriday, 16. February 2018, 10:28 6 years 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

    238 Posts

  • #4, by esmeraldaFriday, 16. February 2018, 11:07 6 years 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. 

    Key Killer

    514 Posts

  • #5, by wimfFriday, 16. February 2018, 11:14 6 years 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

    238 Posts

  • #6, by esmeraldaFriday, 16. February 2018, 11:26 6 years 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...

    Key Killer

    514 Posts

  • #7, by stothewFriday, 16. February 2018, 15:48 6 years 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

    127 Posts

  • #8, by wimfFriday, 16. February 2018, 16:37 6 years 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

    238 Posts

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

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

    and move it e.g. like this?

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

    Forum Fan

    127 Posts

  • #10, by wimfFriday, 16. February 2018, 18:01 6 years 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

    238 Posts

  • #11, by wimfSaturday, 03. March 2018, 09:48 6 years 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

    238 Posts