- Home /
Question by
StanTheGuy · Sep 27, 2016 at 10:39 AM ·
character controllercharacter movementcharacter controlling
Early FPS Style Character Controller (No mouse)
Hello,
So I am getting very confused with my code. Decided to pop it here to see if anyone can help guide me on where I screwed up.
The script I am battling with is: `
using UnityEngine;
using System.Collections;
public class EarlyCharacter : MonoBehaviour {
public float mSpeed = 3.0F;
public float xAxisValue = Input.GetAxisRaw("Horizontal");
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float translation = Input.GetAxis("Vertical") * mSpeed;
translation *= Time.deltaTime;
transform.Translate(0, 0, translation);
if(Camera.current != null)
{
Camera.current.transform.Translate(new Vector3(xAxisValue, 0.0f, 0));
}
}
}
I am trying to have the horizontal axis control the players turning and the vertical axis control forward and backward movement. (Like Doom or Heritic character movement)
Comment
Your answer
Follow this Question
Related Questions
How to make a 3rd person character controller 0 Answers
Character Creeping Backwards 0 Answers
how to make 2d character jump? 0 Answers