Unity physics

If you want to use physics engine for your object (gravity, forces), make sure to add Rigidbody compoment. To interact with other physics objects attach collider object.
Rigitbody properties:
Mass – helps to figure out winner of collision
Drag – how quickly it will come to rest.
Angular Drag – rotation friction (opposite torque)
Use Gravity – impacted by general gravity or not. (Edit->ProjectSettings->Physics)
Is Kinematic – will rigidbody react to physics. Physics objects that affects others, but are not affected themselves. Translate updates collision data when object is moved. Static objects cause all objects to be reevaluated.
Interpolate – solve jittering if it was created by moving rigidbody. Interpolate smoothes transform based on previous frame. Extrapolate – smoothes based on predicted next frame.
Collision Detection – type of detection. Continuous for fast moving objects that are interacting with static geometry. Continuous Dynamic – fast moving and interacting with other dynamic objects.
Constraints – possible to lock axes for position or rotation.

AddForce(Vector3 direction & magnitude, [ForceMode mode]) – move object by adding forces;
Acceleration – continuous changes not affected by mass,
Force(default) – for continuous changes affected by mass,
Impulse – instant change affected by mass,
VelocityChange – instant change not affected by mass.
Forces ar dampened by rigidbody drag property.

AddTorque(Vector3 torque, [ForceMode mode]) is similiar for rotations

p.s transform.forward – shortcut to z axis of localspace of object.
Physics materials describes surface of object for friction and how object material affects it – like tenis ball vs. bowling ball

Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *