Skip to main content

NetworkRigidbody inside Boss Room

note

Required reading: Physics

Boss Room leverages NetworkRigidbody to simulate physics-based projectiles. See the Vandal Imp’s tossed projectile, the ImpTossedItem prefab. At its root, this Prefab has a NetworkObject, a NetworkTransform, a Rigidbody, and a NetworkRigidbody component. Refer to TossAction.cs for more implementation details.

An important note: Any modifications to a Rigidbody that involve Physics (that is, modifying velocity, applying forces, applying torque, and the like) must be done after the NetworkObject is spawned since NetworkRigidbody forces the Rigidbody’s isKinematic flag to be true on Awake(). Once spawned, this flag is modified depending on the ownership status of the NetworkObject.