Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

[Resolved]Begin position of moving object to low

  • #1, by wimf 8 years ago Zitieren
    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
  • #2, by wimf 8 years ago Zitieren
    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
  • #3, by wimf 8 years ago Zitieren
    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

  • #4, by esmeralda 8 years ago Zitieren
    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. 
  • #5, by wimf 8 years ago Zitieren
    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
  • #6, by esmeralda 8 years ago Zitieren
    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...
  • #7, by stothew 8 years ago Zitieren
    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
  • #8, by wimf 8 years ago Zitieren
    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
  • #9, by stothew 8 years ago Zitieren
    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)
  • #10, by wimf 8 years ago Zitieren
    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.
  • #11, by wimf 8 years ago Zitieren
    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