Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PointEffector2D

Applies forces to attract/repulse against a point.
Read time 6 minutesLast updated 5 days ago

Definition

public class PointEffector2D : Effector2D

Remarks

When the source Collider2D is a trigger, the effector will apply forces whenever the target Collider2D overlaps the source. When the source Collider isn't a trigger, the effector will apply forces whenever the target Collider2D is in contact with the source only.
This effector is designed primarily to work with source Collider2D that are set as triggers so that target Collider2D can overlap the defined area.

Properties

Property

Description

angularDampingThe angular damping to apply to rigid-bodies.
distanceScaleThe scale applied to the calculated distance between source and target.
forceMagnitudeThe magnitude of the force to be applied.
forceModeThe mode used to apply the effector force.
forceSourceThe source which is used to calculate the centroid point of the effector. The distance from the target is defined from this point.
forceTargetThe target for where the effector applies any force.
forceVariationThe variation of the magnitude of the force to be applied.
linearDampingThe linear damping to apply to rigid-bodies.

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.