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.
—
Image#2: normal object with collider2D and rigidbody2D, when it enters point effector area, it gets affected by it
—
Results for the settings above:
Related Posts
3 Comments + Add Comment
Leave a comment
Recent posts
- MotionVector Effect: Object “disappears” when paused
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
Recent Comments
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on
This is AWESOME! What a great feature! Thank you for making me aware of it!
More 2D effectors presented here:
https://youtu.be/9DmRNlIJIp0?t=34m15s
live training coming up:
2D Physics: Fun with Effectors
Monday, April 6th
http://unity3d.com/learn/live-training/session/2d-physics-fun-effectors