A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'DOTS Physics' started by filod, Dec 16, 2019.
Do we have a workaround?
That depends. If you don't need trigger events from your character, which is unlikely, you can just setup the collision filters so that character ignores triggers.
However, if you need trigger events, we have a workaround, but it's not very simple to share. Will try to come up with something shareable.
without Trigger events many gameplay logic can't be achieved (deadzone, door switch, etc.), so i'm very confused about this default behaviour.
i'd like to see your sharing, Thx very much.
Yeah, it's not designed to work like that, it's just an issue that will be fixed soon.
Also i'd like to point out another strange behaviour is that character will not fire collision event either (mostly) because of SkinWidth, was this on purpose or a bug too?
Collision events are only going to be raised when the likes of a dynamic body is flying at the character and inter-penetrations occur. The rest of the time the character controller code is trying to stop the character from getting into an interpenetrating state in the first place, and is handled collision information independently from the solver.
So, one perspective is that collisions are collision and the CC should be raising collision events. The other perspecitive is that the CC contacts handled by the simplex solver should be considered different from the interpenetrating contacts handled by the general solver.
Its sounds like the former is your expectation and the latter is the current design? I do think the two sets of collision information are fundamental different.
What is your higher-level need? Rather, than trying to combine the internal CC collisions with the general simulaiton collision list, if the CC exposed the internal collision it resolves would that cover your need?
agreed, but my need is very simple&common, just want to play a SFX/VFX when Character land on ground. KCC provide something called OnGroundHit, also something like OnMovementHit would be helpful too (e.g. place hand on the wall).
i think exposed the internal collision would be a good way to extend current functionality of CC.
@petarmHavok can we have that workaround now? or some guide so i can deal with it myself?
I'm preparing the workaround, sorry for the delay.
Also really interested in this
Attached you can find the changes to character controller which should result in not colliding with triggers, and also raising trigger events. It is probably a little too complicated, so I'll look more into the proper fix.
Let me know if it works for you!
works quite well, thx very much!
Big thanks for the fix! At first I forgot to add the PhysicsVelocity component to the character and wondered why the trigger event is not firing. But now everything works really well.
Thank you for trying out and reporting issues!
Just a small update, the line 155
m_lastColliderKey = new ColliderKey();should actually be
m_lastColliderKey = ColliderKey.Empty;
I've attached the updated code in case someone else needs it.