Rocket not subject to gravity?

unity unity1


I was on the ‘Resolving Movement Bugs’ Lecture and updated my script to have rigidBody.freezeRotation under the private void Rotate, as seen from the pictures, most recently. However, my rocket doesn’t fall to the launchpad (it used to). When I press space it doesn’t move at all but when I press A and D it rotates at the location it is seen in the picture? Something has changed but I can’t figure out what?

Hi Efe, welcome to the community. :slight_smile:

Untick the Rigidbody’s Is Kinematic property on the Rocket Ship Gameobject. You want the GameObject to be under the control of the physics engine, hence adding relative force to move it, and the desire for gravity to take effect.

Please note, it’s better to copy/paste your code and apply the code fencing characters, rather than using screenshots. Screenshots are ideal for displaying specific details from within a game engine editor or even error messages, but for code, they tend to be less readable, especially on mobile devices which can require extensive zooming and scrolling.

You also prevent those that may offer to help you the ability to copy/paste part of your code back to you with suggestions and/or corrections, meaning that they would need to type a potentially lengthy response. You will often find that people are more likely to respond to your questions if you make it as easy as possible for them to do so.

Hope this helps :slight_smile:


See also;

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms