Untitled

 avatar
unknown
plain_text
3 months ago
464 B
5
Indexable
# Simple 1D Game in Unity

using UnityEngine;

public class Simple1DGame : MonoBehaviour
{
        public GameObject player;
            public float moveSpeed = 5f;

                void Update()
                    {
                                float move = Input.GetAxis("Horizontal") * moveSpeed * Time.deltaTime;
                                        player.transform.position += new Vector3(move, 0, 0);
                    }
}

                    }
}
Editor is loading...
Leave a Comment