Interpolate position with change image attribute

gambetgambet Member Posts: 38
edited November -1 in Working with GS (Mac)
Hello,

I want when my actor spawns to:

change image
interpolate y position to self.position.Y+30 for 0.75s
change image
interpolate y position to self.position.Y-30 for 0.75s
change to default image
accelerate

The actor supposed to change image, move with that image for 30pixels down,
then change image and with that second image move up 30 pixels and change back to default image and turn on accelerate behavior.
When I put this in GameSalad the results are strange.
What is the best way to do something like this?

Comments

  • old_kipperold_kipper Member Posts: 1,420
    in turn add each destination to a new self real attribute then fire the next image and interpolate off reaching that position.

    hope that helps

    Kipper
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    to explain more what kipper means: You cannot interpolate to selfposition + or - a number. Since the interpolate is constantly triggering, the expressiong changes so thats why your getting strange results

    so what you do is make a real attribute, call in interpolatepos
    have a change attribute behavior changing interpolatepos to selfposition.y-30(or change the attribute to self position y+30 if thats what u want to do)

    then in your interpolate, have self position y and interpolate to the interpolatepos attribute you made
  • gambetgambet Member Posts: 38
    after this (if I understood correctly):
    change atribute self.pos to self.position.Y+30
    change image
    interpolate y position to self.pos for 0.75s
    change atribute self.pos to self.position.Y-30
    interpolate y position to self.pos for 0.75s
    change to default image
    accelerate

    actor spawns with default image (not changing at all)
    interpolate to y+30
    start accelerate behavior
Sign In or Register to comment.