UFO with sound, updated controls and cleaner code

I’m finding the turning to be very jerky with my keyboard, is there any way to soften it?

2 Likes

So it turns out that playing in game mode in Unity is not at all like playing once compiled.
In the compiled version (with mass set to 0.5 like in the video above) the ship wouldn’t leave the ground.
I had to set the mass to 0.1 and with that once compiled the ship controls beautifully and smoothly.
However at 0.1 in Unity the ship shoots up super fast in game mode.

Very inconsistent.
Is there a way to make them both work the same?

1 Like

So to answer my own question… watching the next video we finally learned how to use Time.deltaTime and although by the end of the video we have applied it to the rotation it was not applied to the thrust and I still had issues with the build not matching the game mode in Unity.

So I added float thrustThisFrame = mainThrust * Time.deltaTime; above the thrust input line and changed rigidBody.AddRelativeForce(Vector3.up * mainThrust); to rigidBody.AddRelativeForce(Vector3.up * thrustThisFrame); and now the issue is fixed.

I dig the lights!

Privacy & Terms