angularVelocity
The angular velocity of the Rigidbody or ArticulationBody that belong to the collider that your Component collides with (Read Only).
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.PhysicsModule
public Vector3 angularVelocity { get; }
Remarks
The angular velocity of the Rigidbody or ArticulationBody that belong to the collider that your Component collides with. The returned velocity is the one recorded at the moment of collision rather than the current velocity. If the collider doesn't have a Rigidbody or ArticulationBody attached, this returns _zero.
Examples
using UnityEngine;public class ExampleScript : MonoBehaviour{ void OnCollisionEnter(Collision collision) { // Print the angular velocity of the body we've collided with. Debug.Log($"Collided with: {(collision.body ?? collision.collider).gameObject.name}, angular velocity at collision time {collision.angularVelocity}."); }}