- Home /
3rd person unit control
My general idea is to have a game where tanks move around, and can attack each other.
I want human players to be able to control the tanks from 3rd person, and direct the tanks based on the orientation of the camera. EG: the camera is facing towards the map's sw (but looking at the tank at an angle of 45 degrees), and the player uses a key / ui element, to give a direction towards the top of the screen, which should instruct the tank to move towards the map's sw. This would also correlate to any direction that is related to the camera's position, in relation to the global map direction.
My setup is to have the tank be given a direction vector, which is in relation to it's current forward vector, and then move towards that.
The issue, is I'm having an issue converting the "ui/camera" direction the human player gives, to a direction in relation to each tank, so the tank can rotate / move towards that direction using "RigidBody.MovePosition" and "Rigidbody.MoveRotation".
The ai for a tank will use waypoints, and just calculate an angle between the tank and the waypoint it wants, so that's not an issue.
How should I go about this?
Your answer
Follow this Question
Related Questions
Making player face the direction it moves (using angles). 1 Answer
Rotating character based on joystick angle, at an angle 0 Answers
Set rotation based on 2 points problem 1 Answer
Objects rotate but remain on the original axis... 0 Answers
How to rotate a character facing direction of movement like sonic the hedgehog 2 Answers