Move Object to Actionpart not Absolute

  • #1, z dionousSunday, 25. June 2017, 19:47 hodinky 7 years ago
    Hello to all,

    Have a scene where i'm trying out Move Object To actionpart but the object always moves in relation to the object (offset) and not to the absolute position. Can u confirm this pls?

    Using 5RC1.

    Rgrds

    Fanoušek fóra

    246 Posts


  • #2, z sebastianSunday, 25. June 2017, 19:52 hodinky 7 years ago
    THere are two action parts which can move an object

    move object to -> absolute
    move object (by) -> relative

    The normal "to" should move to an absolute position as far as i know. If not I would consider this as a bug^^


    Kapitán

    2346 Posts

  • #3, z dionousSunday, 25. June 2017, 22:58 hodinky 7 years ago
    Yes, basically 'move object to' should be absolute, but it's relative instead, so it looks like a bug indeed.

    Fanoušek fóra

    246 Posts

  • #4, z SimonSWednesday, 28. June 2017, 21:22 hodinky 7 years ago
    The action part doesn't work as you might expect it, it uses ObjectPosition to calculate the absolute position, so set the ObjectPosition to the top left of the image if you want to use it on sprites.

    Kapitán

    1582 Posts

  • #5, z dionousThursday, 29. June 2017, 10:31 hodinky 7 years ago
    Thanks Simon,

    It's a bit strange, and i still think there is some issue so i've PM'ed you a test ved if you could take a look.


    Fanoušek fóra

    246 Posts

  • #6, z SimonSThursday, 29. June 2017, 10:44 hodinky 7 years ago
    Please set the position of the image and then try again.

    Kapitán

    1582 Posts

  • #7, z dionousThursday, 29. June 2017, 11:44 hodinky 7 years ago
    Now that's clear, thanks so much! Keep up the great work.

    Fanoušek fóra

    246 Posts

  • #8, z dionousThursday, 29. June 2017, 13:12 hodinky 7 years ago
    By the way, would it be possible to use this absolute movement with LUA?

    For now i can only remember ObjectOffset which is relevant movement.

    Thanks

    Fanoušek fóra

    246 Posts

  • #9, z ke4Thursday, 29. June 2017, 13:38 hodinky 7 years ago
    You can calc the absolute position based on the object position.
    For example your object is at position x 500,y 500 and you want to move it to absolute position x 250, y 750 then:

    Offset x = (Object.name.Position.x - wanted position x)*-1
    offset y = (Object.name.Position.y - wanted positon y)*-1


    Zabiják klíčů

    810 Posts

  • #10, z dionousThursday, 29. June 2017, 16:10 hodinky 7 years ago
    Yeap, that's a good way to solve this , thanks!

    Fanoušek fóra

    246 Posts

  • #11, z MachtnixThursday, 29. June 2017, 16:39 hodinky 7 years ago
    Why don't set the character directly on the wanted position??

    Kapitán

    1097 Posts