A second collider on my player Character class won't trigger overlaps/queries?

I’m using the root capsule of my player Character class for movement. So I’ve my plan is to add extra collider to trigger specific overlap events. The thing is, the second collider won’t overlap/query/trigger/hit anything?

I know a second collider won’t affect movement (in the Character class) but I thought it would do overlaps/queries?

Thank you :slight_smile:

You should screenshot your collision settings (something like this) for your Pawn’s sensor, and the object you want to overlap. Taka a note at the marked things.

  1. Generate Ovelap Events must be checked
  2. Collision Enabled should be Overlap, Block, or both.
  3. What Object type are you overlapping? It also must overlap Pawn object type (unless you picked some other object type for your sensor)
  4. Look at the Reponses part, make sure both overlap each other. Your Pawn’s sensor, and the new object you have created.

Thank you @Bojann Thanks to your response, I was able to get ‘On Component Begin Overlap’ working.

Ideally though, I’d prefer to use ‘On Component Hit’ because it gives a constant update on collision (not just a one-frame overlap event) but without causing any physics happening. So I’ve been trying the following:

My Character class

My static actors class

Is it possible to use ‘Simulation Generates Hit Events’ in this way with a second collision component on a Character class?

As far as I know, components either hit or overlap. I never used Hit without any physics happeniong, nor I think that is possible. Using OnBeginOverlap, and OnEndOverlap should be sufficient enough.

Hit also happens once as far as I know, unless there is bounciness.

Can you give me a bit more context on what do you want to achieve. Full usecase perhaps?

Again, thank you @Bojann.

The following custom collision presets gave me hope that I could use a ‘Hit’ event without physics happening:

image

I’m also not quite sure whether ‘Hit’ is a one-event… but I suspect it might fire as long as the hit is occurring (i.e. while there is penetration).

Regarding a use-case, I’m using a SpringArm and Camera setup that lags behind my player. It works well, but sometimes… when the player cuts a corner… the camera goes through the level geometry. The built-in SpringArm ‘Do Collision Test’ is too jerky for my purposes.

So my intention is to position a collider between the camera and my player mesh. While an object hits the collider, I’ll shorten the SpringArm and speed up the lag… solving the problem of the camera clipping through the level geometry. Yes, it’s possible to do this with a ‘Trace’, but a second collider would be cheaper.

Also, exactly as you say, it’s possible to do it with ‘Begin/End Overlap’… but if ‘Hit’ can give me an ongoing result, for the same cost, this would be best of all I think :slight_smile:

“hit” means approximately “physics detected that these two objects penetrated and should be de-penetrated.”
“hit” won’t happen against a volume that’s overlap-only. You can hit an invisible wall, but not a trigger volume.
Also, the CharacterMovementComponent doesn’t really do full physics; it does its own thing to make player movement work and feel the way a first-person player would expect it to, which is decidedly not physical.

OK got it. But to be honest, I would still go with overlap. I am not familiar with your project so I cannot tell what is the best solution here. :slight_smile:

Thank you to both of you, @Bojann and @jwatte :slight_smile:

Yes, I think that ‘Overlap’ will give me a result.

But just as @jwatte says, I think ‘Hit’ will fire as long as there is penetration. So is there some way I can use this property in one of the Custom collision presets, without *(trying to) affect physics, and get a constant ‘Hit’ event while there is penetration?

image

Like if both the pawn’s second collision component and my static level geometry use the same ‘Hit’ collision parameters?

*Exactly as you say @jwatte, strictly speaking, the character movement component will only pay attention to the root capsule anyway.

No, there is no way to re-use “hit” as some kind of “repeating overlap.” The two kinds of collision are intended to solve very different problems.

The best you can do, is to set a flag when you enter some volume, and check this flag in Tick, and then clear the flag when you exit the volume.