How to make an actor move away from point of touch?

Dell7730Dell7730 Member, PRO Posts: 388

I would like an object to move the opposite direction of a touch, like when I touch the left side of any actor, it would move to the right, and it has to move to the exact angle, if I touch it at 25 degrees at the bottom left of the center of the actor, then the actor will move towards 25 degrees to the upper right.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Move to mouse x, mouse y, speed -100.

  • SocksSocks London, UK.Member Posts: 12,822

    Also try Accelerate Towards mouse x, mouse y, speed -100.

  • ArmellineArmelline Member, PRO Posts: 5,407

    Also, if you want to be using a move behaviour or something like that, you can use:

    vectorToAngle(self.Position.X-game.Touches.Touch 1.X,self.Position.Y-game.Touches.Touch 1.Y)

  • Dell7730Dell7730 Member, PRO Posts: 388

    thanks guys

Sign In or Register to comment.