Hey,
So the situation is that, I have an Enemy that walks around everything, like a spider (Dynamic rigidbody in order to interact with other objects), and I have platforms with PlatformEffectors.
So this Enemy has a little velocity pointing down in local space like a “local gravity”, and the problem is, when it walks on a bottom of a platform it just falls through it.
I would like to keep things this way with the Enemy, because it fits well with other things, and find a way to enable collision between it’s collider and the bottom of the platform which is turned off by the PlatformEffector.
So what I have tried was to uncheck the “Use Collider Mask” on the effector, and define OnCollisionEnter2D function, and just use Physics2D.IgnoreCollision(Collider2D, Collider2D, false) function, which didn’t work for me.
So I’m a littlebit stuck with this.
If somebody has some idea please throw at me, Cheers
You can’t describe what you mean by “bottom of a platform”? You can’t describe or show what the collider is that the platform effector is connected to (what’s a “, I have a rectangle shaped collider2D,”) - BoxCollider2D?
Need more information beyond a description.using your own terminology really. Please use Unity types in your descriptionse etc.
On the picture you can see, the BoxCollider2D and the PlatformEffector2D, and On the video you can see the Behaviour, that I described in my post.
Link: https://bit.ly/3sTsT2f
There’s no feature to allow certain layers to not be affected by the effector. You can only control contacts.
A workaround is to place another BoxCollider2D on a child GameObject at the same location and have that only contact the Spider layer. Because that doesn’t have an effector, it’ll act like a standard collider to spiders only.