Mar
11
2015

PointEffector2D

Unity5 comes with new PointEffector2D

How to use it?
– Add sprite to scene
– Add CircleCollider2D (or some other 2D collider)
– Enable: [x] Trigger *Note: Effector works without trigger enabled also, but only when other object is touching the collider.
– Enable [x] Used by Effector
– Add PointEffector2D component
– Adjust Force magnitude (if it doesnt seem to affect enough, negative values will attract and positive values will repel objects away)

Then just add other objects that the effector will affect:
– Add sprite
– Add rigidbody2D
– Add CircleCollider2D (or some other 2D collider)

Image#1: Point effector, note the circle collider radius is adjusted, that is the area it affects.

point_effector2d_1

Image#2: normal object with collider2D and rigidbody2D, when it enters point effector area, it gets affected by it

point_effector2d_2

Results for the settings above:

point_effector2D


3 Comments + Add Comment

Leave a comment

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.