"Move To" behavior problem

sebmacflysebmacfly Member Posts: 1,018
edited November -1 in Working with GS (Mac)
Hello Gamesalad community :)

I have a problem using the "Move To" behavior...
So much time when i use that behavior to move an actor from (0,0) to (250,400) (for exemple), my actor don't stop and go out of the screen...

I'm the only one who have that problem? Or can I do something to solve it?

Thanks, have a good day! :)

Comments

  • expired_012expired_012 Member Posts: 1,802
    The only reason your actor is going offscreen is because (250, 400) is an off screen position
  • expired_012expired_012 Member Posts: 1,802
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Use the Interpolate behavior instead.

    Interpolate self.Position.X To: 250 duration: 1 second
    Interpolate self.Position.Y To: 400 duration: 1 second

    Much more reliable than Move To.
  • victorkin11victorkin11 Member Posts: 251
    check the
    relative to scene
    relative to actor
    option
  • sebmacflysebmacfly Member Posts: 1,018
    @artonskyblue :
    No man, it's an iPad game... (forgot to say it)

    @victorkin11 :
    It's "Relative to scene"

    @firemaplegames :
    What's the difference between "Move to" and "Interpolate" ?

    Thanks
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Interpolate 'tweens' attributes from one value to another. Position, colors, alpha, etc. Any attribute can be Interpolated.

    Move To is an old behavior used to move an Actor from one position to another. It's still supported so it doesn't break anybody's code, but it's buggy and Interpolate is much more powerful.

    And if you couple Interpolate behaviors with Timers, you can create a basic tweening engine:

    Interpolate self.Position.X To: 250 Duration: 1 second Easing: ease out
    Timer After 1 second run to completion
    -----Interpolate self.Position.Y To: 200 Duration: 1 second Easing: ease out
    -----Timer After 1 second run to completion
    ----------Interpolate self.Position.X To: 400 Duration: 1 second Easing: ease out

    This will let you animate things in a sequence.

    You can transition menus and buttons in an out, you can create complex sequential animations, etc.

    Interpolate is definitely one of the coolest and most powerful additions to GameSalad in recent months. It allows you to emulate the motion tweening capabilities of Flash.

    I highly suggest you check it out!
  • sebmacflysebmacfly Member Posts: 1,018
    Thanks, nice job! that will help me a lot ;)
    Can i choose the speed movement? what's the best way to make a very fast movement?
Sign In or Register to comment.