- Home /
i cant tell if unity is glitching for me
Hello all, i have a problem with unity. so basically i am using unity 4.3's 2D feature to make a simple very small platformer. i imported my sprites and added collision to them and i added a rigid body to the main character. i tested the game out and it was fine. everything was going fine until i went to the codeing part, this my first time using c# im a complete beginer. i wrote a very simple move script: using UnityEngine; using System.Collections;
public class CharacterMovement : MonoBehaviour {
// Use this for initialization
public float PlayerSpeed = 5.00F;
void Start () {
transform.position = new Vector3 (1, 2, 0);
}
// Update is called once per frame
void Update () {
transform.Translate (Vector3.right * Input.GetAxis("Horizontal") * PlayerSpeed);
}
}
i tested the game out for the first 5 seconds it was fine then ramdomly the main character just randomly started moving about without me touching the keyboard and then stops colliding. i go left the player goes right. i dont understand if it is a glitch or not, please help.
Thank You
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Implementing Scoring System 2 Answers
Noob Question -- Programming 2d platformer 1 Answer
Alarm lights not changing 1 Answer
[Unity 4.3] 2D physics - SpeedUp Platform/Slope [C#] 0 Answers