Character should not collide with trigger

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.

1 Like

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.

2 Likes

Also really interested in this :slight_smile:

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!

5396706–547506–CharacterControllerUtilities.zip (5.83 KB)

2 Likes

works quite well, thx very much!

1 Like

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.

1 Like

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.

5400648–548094–CharacterControllerUtilities.zip (5.83 KB)