Going straight in one direction
Hey Guys, I Am trying to have the player input in a location with a touch and from there an actor is spawned and goes to that location, in a straight line, but I want the actor to travel past the selected location, but at a constant speed. I guess it would be similar to the Accelerate toward, but with out the acceleration. I tried the move to Behavior but it stops at the location where I want it to go past and continue traveling. Any ideas?
Thanks
Thanks
Comments
currY = current Y position of actor
tapX = X position where user tapped (i.e. game.tapX)
tapY = Y position where user tapped
Use Change Velocity in the spawned actor to set the velocity with a rotation of:
vectorToAngle(currX-tapX,currY-tapY)
That should do it...
Dave
Thanks for your help, I got it to work.
YESSSSSS!!!!!!!!