Please help me because this drives me nuts.
I am trying to make a first person game where the player flies in the space. The camera is controlled by mouse, and the player flies automatically where the camera points.
This is the script for the camera movement:
var flySpeed = 1;
var defaultCam : GameObject;
var playerObject : GameObject;
function Update()
{
if (Time.timeScale>0)
transform.Translate(Vector3.forward * flySpeed);
}
When I comment the translate part, the music plays perfectly, my camera stays, where it was when i started the game, and it can only look around.
When i uncomment this part, the camera flies, but the music plays faster or slower. It depends on, where i look with the camera.
The component for the music and the main camera has nothing to do with each other (so neither of them is children of the another)