Unity movement | Sololearn: Learn to code for FREE!

0

Unity movement

May someone assist with some 3D movement for Unity in C#?

3/7/2020 3:40:42 PM

Samuel Mubukwanu

2 Answers

New Answer

0

public void Update(){ if(Input.GetKey("d")){ var Movement = transform.position; Movement.x += 0.9f; transform.position = Movement; } else if(Input.GetKey("a")){ var Movement = transform.position; Movement.x -= 0.9f; transform.position = Movement; } } Its just a basic example of movement, put this code on Update method and insert the script on Character Object inside the scene

+1

There's an excellent document known as the "Unity Manual" https://docs.unity3d.com/Manual/index.html which you may find worth reading.