- Home /
How to make a 3D character move only left and right in 3D environment?
I am starting to create a platform third person causal game. The third person character from the download package isn't helping. I don't know what to do here. I want to make the character model move just left and right and jump. I need to know how to make the camera follow the character as the player moves up on screen?
Answer by DGree · Jun 18, 2013 at 02:36 AM
This Script should work just apply to player!
using UnityEngine; using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
void Awake () {
}
void FixedUpdate () {
if (Input.GetKey("a")) {
rigidbody.AddForce (-Vector3.right * speed * Time.deltaTime);
}
if (Input.GetKey("d")) {
rigidbody.AddForce (Vector3.right * speed * Time.deltaTime);
}
}
This is also a C# script!
Your answer
Follow this Question
Related Questions
moving platforms? 0 Answers
Jerky 3rd Person Camera Following Movement and Rotation 0 Answers
How can i make the camera look up and down through keyboard keys? 2 Answers
Why is my third person camera making this arc movement? 0 Answers
Making A Tileset 1 Answer