SurfaceEffector2D
Applies tangent forces along the surfaces of colliders.
Read time 6 minutesLast updated 3 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
- Inherits from: Effector2D
public class SurfaceEffector2D : Effector2D
Remarks
When the source Collider2D is a trigger, the effector will apply forces whenever the target Collider2D overlaps the source. When the source Collider2D isn't a trigger, the effector will apply forces whenever the target Collider2D is in contact with the source only.
This effector can be used to create constant speed elevators and moving surfaces.
Properties
Property | Description |
|---|---|
| forceScale | The scale of the impulse force applied while attempting to reach the surface speed. |
| speed | The speed to be maintained along the surface. |
| speedVariation | The speed variation (from zero to the variation) added to base speed to be applied. |
| useBounce | Should bounce be used for any contact with the surface? |
| useContactForce | Should the impulse force but applied to the contact point? |
| useFriction | Should friction be used for any contact with the surface? |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |