Im trying to learn Unity3d from a tutorial. I have a rocket prefab where the rocket moves up when I click the space button, and in the tutorial next step is to put the audio source. But when I put the audio source, without changing anything else, the movement doesn’t work as well. As if the object became heavier (it works if i decrease the mass of my rigidbody). Why could this be and how can I fix this?
This is the code i have. Doesn’t matter if this code is added or not the problem persist if i comment it out too.
if (Input.GetKey(KeyCode.Space))
{
rigidBody.AddRelativeForce(Vector3.up);
if (!audioSource.isPlaying)
{
audioSource.Play();
}
}
else
{
audioSource.Stop();
}
Expected result is the speed of my rocket doesnt change. But it changes(slows down/ doesnt fly at all),
Im trying to learn Unity3d from a tutorial. I have a rocket prefab where the rocket moves up when I click the space button, and in the tutorial next step is to put the audio source. But when I put the audio source, without changing anything else, the movement doesn’t work as well. As if the object became heavier (it works if i decrease the mass of my rigidbody). Why could this be and how can I fix this?
This is the code i have. Doesn’t matter if this code is added or not the problem persist if i comment it out too.
if (Input.GetKey(KeyCode.Space))
{
rigidBody.AddRelativeForce(Vector3.up);
if (!audioSource.isPlaying)
{
audioSource.Play();
}
}
else
{
audioSource.Stop();
}
Expected result is the speed of my rocket doesnt change. But it changes(slows down/ doesnt fly at all)