PointEffector2D
Applies forces to attract/repulse against a point.
Read time 7 minutesLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
- Inherits from: Effector2D
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 |
|---|---|
| angularDrag | The angular drag to apply to rigid-bodies. |
| distanceScale | The scale applied to the calculated distance between source and target. |
| drag | The linear drag to apply to rigid-bodies. |
| forceMagnitude | The magnitude of the force to be applied. |
| forceMode | The mode used to apply the effector force. |
| forceSource | The source which is used to calculate the centroid point of the effector. The distance from the target is defined from this point. |
| forceTarget | The target for where the effector applies any force. |
| forceVariation | The variation of the magnitude of the force to be applied. |
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. |