Did all this before course another way

I wanted to shere my game with friends, and realised that Rocket behaves different way in webGL, so I strarted solving problem by my selfe. In public class:

public float speed = 100f; // public to change speed in unity script window.

So for moving UP I used:

if (Input.GetKey(KeyCode.Space))
        { RocketBody.AddRelativeForce(Vector3.up * Time.deltaTime * speed); }  // After test's I changed speed to 50 in Unity script window.

And after I realised that with perfect balance for rocket mass and UP movement, roket rotation was to slow. So script for rotation is:

if (Input.GetKey(KeyCode.A))
        {
            transform.Rotate(Vector3.forward * Time.deltaTime * 80f); // my speed for rotation
        }
        if (Input.GetKey(KeyCode.D))
        {
            transform.Rotate(-Vector3.forward * Time.deltaTime * 80f); // my speed for rotation
        }

But yeah… After few topics, we strarted to this in course and I putted in teacher’s solution. With wierd words like: [SerializeField]

Privacy & Terms