Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SurfaceEffector2D

Applies tangent forces along the surfaces of colliders.
Read time 6 minutesLast updated 3 days ago

Definition

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

forceScaleThe scale of the impulse force applied while attempting to reach the surface speed.
speedThe speed to be maintained along the surface.
speedVariationThe speed variation (from zero to the variation) added to base speed to be applied.
useBounceShould bounce be used for any contact with the surface?
useContactForceShould the impulse force but applied to the contact point?
useFrictionShould friction be used for any contact with the surface?

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.