Question by
lod_ashtaroth · Jun 22, 2018 at 04:25 PM ·
c#charactercamera rotatecamera movement
FPS Character not moving in relation to direction/rotation
Hi I'm trying to make a First Person sword death match game. Im currently going for Doom1 style controls, that is typical FPS mouse/key controls minus vertical aim.
I'm having trouble with WASD controls in relation to my camera direction. My character will always walk the same directions regardless of the way Im facing.
Here is the function I'm using:
void DoomMove() {
Vector3 Movement = new Vector3 (Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
transform.position += Movement * movementSpeed * Time.deltaTime;
float horizontal = Input.GetAxis ("Mouse X") * turningSpeed * Time.deltaTime;
transform.Rotate (0, horizontal, 0);
}
Comment
Your answer
Follow this Question
Related Questions
How to rotate camera diagonally over players shoulder while still facing towards players direction 0 Answers
3d camera not working as I want it to 0 Answers
C# 360 Orbital Camera Controller (Gimbal Lock Issue) 1 Answer
How to limit the rotation of my third person camera? 1 Answer
Camera gets closer to the player when looking at it from certain angles. 0 Answers