Applying SurfaceEffector2D force at point of contact

Hello,

I’m using the SurfaceEffector2D to apply a tangential force along an EdgeCollider2D. The effector is applying the tangential force to the center of the object being touched. I need it to apply the force at the point of contact to realistically simulate a conveyor belt. Is there a way to achieve this with effectors?

The SurfaceEffector2D script reference has a lot of variables that aren’t available in the editor or through scripting. For instance, useFriction and useBounce. Are these options going to be added in an update? Unity - Scripting API: SurfaceEffector2D

You want to use ‘contactForce’ which applies the force at the contact point and was added to 5.0.0p1 (first 5.0 patch) so I guess you’re using the first 5.0 release?

Try updating to: 5.0.0p2

Hope this helps.

Thanks for the response! I’ve downloaded the latest Unity and now see the Use Contact Force option. It behaves much more realistically, but it still not perfect for my use case.

From playing with the surface effector for a while, it appears that the force is applied at the contact point separately from when the collision is resolved. That means that friction from the surface will be fighting my moving object as it is pushed by the effector. Disabling friction wouldn’t work either, because the friction is needed for it to behave realistically. What I really need is for the friction itself to be moving the object.

The game we’re working on is a port from XNA in which we used Box2D for physics. While Box2D didn’t have support for setting a surface velocity, it was easy enough to add, which is what we ended up doing. Is a surface velocity is obtainable with the current 2D physics? Is it something that might be added? The entire game is based on this mechanic so it’s important for me to get it right.

Thanks again!

-Joe

I’m really not sure what you’re asking for here; I don’t understand the problem or what you see the solution as.