Beginner coder here,
just trying to work out how to get a sprite to move a certain direction and distance at a certain speed.
At the moment I have
transform.Translate (new Vector3 (1, 0, 0) * Time.DeltaTime);
Any help is appreciated thanks.
Beginner coder here,
just trying to work out how to get a sprite to move a certain direction and distance at a certain speed.
At the moment I have
transform.Translate (new Vector3 (1, 0, 0) * Time.DeltaTime);
Any help is appreciated thanks.
Make sure you use the search function of UA, this gets asked alot.
void Update()
{
if (Input.GetKey("a"))
{
transform.Translate (Vector3.Left * Time.DeltaTime);
}
if (Input.GetKey("d"))
{
transform.Translate (Vector3.Right * Time.DeltaTime);
}
}