Interface IContactEventHandler
Default implementation required to register a Rigidbody with a Rigidbody
Namespace: Unity.Netcode.Components
Assembly: Unity.Netcode.Runtime.dll
Syntax
public interface IContactEventHandler
Remarks
Recommended to implement this method on a Network
Methods
ContactEvent(ulong, Vector3, Rigidbody, Vector3, bool, Vector3)
Invoked by the Rigidbody
Declaration
void ContactEvent(ulong eventId, Vector3 averagedCollisionNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default)
Parameters
Type | Name | Description |
---|---|---|
ulong | eventId | A unique contact event identifier. |
Vector3 | averagedCollisionNormal | The average normal of the collision between two colliders. |
Rigidbody | collidingBody | If not null, this will be a registered Rigidbody that was part of the collision contact event. |
Vector3 | contactPoint | The world space location of the contact event. |
bool | hasCollisionStay | Will be set if this is a collision stay contact event (i.e. it is not the first contact event and continually has contact) |
Vector3 | averagedCollisionStayNormal | The average normal of the collision stay contact over time. |
GetRigidbody()
Should return a Rigidbody.
Declaration
Rigidbody GetRigidbody()
Returns
Type | Description |
---|---|
Rigidbody |