Please about help Iโm new in Unity and C##
Here my code:
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
public float moveSpeed;
// Use this for initialization
void Start () {
//Player spawn point
//This is where our player star when the game is played.
//player == game object. Game object == transform!
transform.position = new Vector3 (-5, -1, 0);
}
// Update is called once per frame
void Update () {
//Player to move left, righ
//player (gameobject) aka transform to move when i press the wsad
if(Input.GetKey(KeyCode.D))
{
transform.Translate(new Vector3(moveSpeed, 0, 0) * Time.deltaTime) ;
}
if(Input.GetKey(KeyCode.A))
{
transform.Translate(new Vector3(-moveSpeed, 0, 0) * Time.deltaTime) ;
}
}
}
Screen with player inspector panel
Screen with ground inspector panel