How to make a character orbit a target with AddMovementInput
I'm trying to make a character orbit its target in a 3rd-person 3d game, similar to the way zelda or dark souls does it. With what I have now the character spirals out the longer you press the strafe button. I'm trying to take the velocity vector that the movement component creates and angle it so it falls on the orbit path. The formula I'm using for the rotation angle (the one under the character) is:
Angle = ArcCos(.5*V/R)
where V is the speed and R is the circle's radius (distance to target).
This is the blueprint I have. The output vector goes straight into the add movement input node with a scale of ABS(axis input).
What am I doing wrong here? Is there a simpler way to do the same thing?
What is your camera doing during all this? If your character's rotation is always following the camera, and the camera is always facing directly at the target, then your strafe should be constantly adjusting to a 90 degree angle at all times, creating a perfect circle on its own.
answered May 16 '15 at 03:56 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here