Make a ship turn in a cirkel - Help

Toke TToke T Member Posts: 26

Hello.
Hope someone can help with this. I have a ship that follows a push on a touch-screen. The code i use now make it change direction instantly. I would like it to turn like a ship would do.
The code i use now:

constrain.
self.Rotation To: vectorToAngle( self.Motion.Linear Velocity.X , self.Motion.Linear Velocity.Y )

constrain.
self.Motion-Linear Velocity.X To: game.Touches.Touch 1.X - self.Position.X

constrain.
self.Motion-Linear Velocity.Y To: game.Touches.Touch 1.Y - self.Position.Y

Thanks

My Website:http://toket.dk

Comments

  • imjustmikeimjustmike Member Posts: 450

    I'm not 100% sure what you mean. Are you saying that when you move your finger don't want the ship to actually go to it's new location, but follow the path your finger traced? There are plenty of follow path tutorials on the forums for that, just do a quick search :)

    Here's one:

    Or are you saying that you simply want a delay on the ship? If that's the case, you could use a move to behaviour instead of constrains. Demo attached.

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2017

    Here's one approach . . . (file attached)

  • Toke TToke T Member Posts: 26

    @Socks
    Wow! Thanks a lot mate. That was exactly what I was looking for :-)

    My Website:http://toket.dk

  • Toke TToke T Member Posts: 26

    @imjustmike
    Also thanks to you. Good ideas on another direction.

    My Website:http://toket.dk

Sign In or Register to comment.