# Transform inputs don't work

I'm writing a C# player script for a class and when I run, the sound inputs work fine, but the movement inputs don't respond, and I don't know how to fix it.

Code:

Rigidbody rigidbody;
AudioSource audioSource;

void Start(){
rigidbody = GetComponent<Rigidbody>();
audioSource = GetComponent<AudioSource>();
}

void Update(){
ProcessInputs();
}
private void ProcessInputs()
{

if (Input.GetKey(KeyCode.Space))
{
if (!audioSource.isPlaying)
{
audioSource.Play();
}
}
else
{
audioSource.Stop();
}
if (Input.GetKey(KeyCode.A))
{
transform.Rotate(Vector3.forward);
}
if (Input.GetKey(KeyCode.D))
{
transform.Rotate(-Vector3.forward);
}
}

• From what I know of unity, it is generally suggested to not mix adding forces to rigid bodies and manipulating the transform like it is done here. Perhaps using only one approach could help in this situation. – Alexandre Vaillancourt Feb 7 at 0:30

You have to multiply your vectors by a certain value. This value could represent a speed, distance, amount, or force.

So for example,

rigidbody.AddRelativeForce(Vector3.up);


would be

 rigidbody.AddRelativeForce(Vector3.up * 5);


and

transform.Rotate(Vector3.forward);


would be

transform.Rotate(Vector3.forward * 10);