Is it possible to use the surface effector 2d to move two different objects in opposite directions at the same time?
Let s say I have a simple planck with a surface effector 2D on it. By setting the velocity value you can push colliding objects on one direction or the other. Does anyone know if there is a way to use a surface effector 2D for moving two objects in opposite directions at the same time depending on the object type?
Answer by Link0n3 · Apr 02, 2016 at 12:08 PM
I don t know if it can be of some interest but I found I workaround (not sure how optimal it could be).
I used two identical gameobjects overlapped with identical surface effectors and collider. The effectors have the same absolute speed value, but with opposite sign. Then using the collider mask property on the effector you can make them reacts only to the objects you want, thus achieving what I was looking for. It is not optimal as it means I need to actually duplicate my gameobjects with this feature but for now it will be fine.
Your answer
Follow this Question
Related Questions
Collider gets sometimes stuck at wall 0 Answers
Having my GameObject passing trough floor during one frame ( 2D Platformer ) 1 Answer
How can I program diferents velocities to a character? 0 Answers
How to make different sides of a shape act differently in 2d 0 Answers
How to add force based on surrounding colliders in 2D? 0 Answers