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
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
- Check if point is inside polygon 2D (using line intersection)
- UnityHub: Enable Create Project Button (without having to select Cloud Organization)
- UI: Make Tooltip background fit Text content length
- Pong-Wars in Unity
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub)
- UnityHub: Add support for custom project title (instead of folder name) or use ProductName
- Testing Unity MUSE AI
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