Description
The SurfaceVelocity
property of the Collider
class is used to set the local velocity of the surface. This allows objects to slide along the surface, similar to how a conveyor belt operates. This property is particularly useful for creating dynamic environments where objects need to be moved automatically along a surface.
Usage
To use the SurfaceVelocity
property, you can assign a Vector3
value to it, which represents the velocity in the local space of the collider. This will affect how objects interact with the surface, causing them to move in the direction and speed specified by the vector.
Example
// Example of setting the SurfaceVelocity property
Collider myCollider = new Collider();
myCollider.SurfaceVelocity = new Vector3(1.0f, 0.0f, 0.0f); // Sets the surface velocity to move objects along the x-axis