Skip to main content

PhysicsLock

A class in Root.Township, the global namespace.

Component that forces an object's position and/or rotation to fixed values every frame, in local or world space.

  • Listed in Global namespace: P
  • Inherits or implements MonoBehaviour
  • Attributes RequireComponent

Constructors​

MemberWhat it is
PhysicsLock()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

7 private and internal fields
MemberWhat it is
private Rigidbody cachedRigidbodyThe rigidbody on the same object. Not used by the lock.
private Transform cachedTransformCached transform that gets locked.
private bool isLocalTrue locks local position and rotation, false world.
private bool isLockingPositionWhether to lock the position.
private bool isLockingRotationWhether to lock the rotation.
private Vector3 lockedPositionThe position to hold.
private Quaternion lockedRotationThe rotation to hold.

Methods​

1 private and internal method
MemberWhat it is
private void LateUpdate()Sets the locked position and rotation on the transform after physics and animation.