ME FIRST GAMES
games for me and you
What is a Rigidbody?
📌 Rigidbodies control an object's position and rotation through physics simulation.
📌 Simulating physics for a specific GameObject is as simple as adding a rigidbody component.
📌 Paired with a collider, modify the properties on your rigidbody to get it to behave as intended.
📌 Set the Mass, Drag, Angular Drag, and toggle gravity through the inspector windows.
📌 Is Kinematic - When enabled, forces, collisions, or joints will not affect the rigidbody. Movement must be controlled manually through a script. This is more advantageous than a collider alone because interpolation options are available and velocity is readable from the rigidbody.
📌 Interpolate - Allows you to smooth out the effect of running physics at a fixed frame rate. This means, the transform position and rotation will be updated every frame to be (smoothed out), however, the rigidbody won't be updated until the next physics frame.
📌 Collision Detection - Allows you to trade performance for better collision detection between physic frame updates. Use this for fast-moving objects or objects that constantly penetrate through thin walls or colliders.
📌 Moving a rigidbody is different from moving a transform. Rigidbodies can be teleported by setting rigidbody.position and you can interpolate between positions by using Rigidbody.MovePosition. Normal transform position adjustments will not update the rigidbody. It's easy to call the wrong method here, so make sure to move objects according to your needs.
📌 Constraints allow you to lock an object's rotation for a positional or rotational axis. This is a great feature for 2.5d games.
📌 Position, velocity, force, max velocity, and much more can be controlled through scripting. If learning, I recommend you create a scene with some objects and rigidbodies, and play around with them, it's fun.
Leave a Reply.
Me First Games is an independent game studio dedicated to creating unique and bizarre video games.
Star Impact is an upcoming adventure platformer coming to PC, Mac, and Linux.
Copyright (c) 2020 Me First LLC