How can I ignore the phys material of a weapon's pickup trigger?

UE4 v4.10.4

I have a weapon pickup class BP, i.e. ItemBaseStaticBP

  • static mesh (weapon),
  • sphere (when pawn enters allow pickup, when pawn exits disallow pickup), when item held allow drop

I’ve got child classes (bat and knife) of that ItemBaseStaticBP strewn about the level. When the player is within that trigger problems arise.

My player character’s BP and player character’s anim BP are set up so that a sound and particles play/get created when the player “steps” on certain materials.

(Sorry is all poorly worded.)

I want sphere surrounding the pickup-able/drop-able weapon to be ignored by the line trace,
but I’m not sure how exactly to check for it.

Thanks in advance for any help.

Hey Erasio, thanks for checking out.

  1. I’m using LineTraceByChannel.

  2. Sphere Collision setting (base class, and child class are identical) set to OverlapOnlyPawn

"Because in either mode it shouldn’t be hit at all ever. "
I’m pretty sure the sphere is getting hit, because as a temporary workaround, I set the sphere’s collision phys material override to a “nothing” one and now the default sound and particle effect no longer plays.

Note: Initially I set the “default” phys material myself. It’s a placeholder particle effect (nullo-textured) and sound (error sound). I also set up a “nothing” phys material for no sound effect or particle effect.

Both of the default effects play whenever my foot “hits the ground” (visually, via anim notify) when I walk around in the sphere before picking up the weapon, AND while walking within the sphere once it’s attached to the hand socket on my char.

As a temporary workaround, I set the sphere’s collision phys material override to the “nothing” one and now the default sound and particle effect no longer play.

I`ll try to hook up the traceforobject one. I’ll also hook up the sphere to overlap all. That’s easy, but after spending all day yesterday mucking with collision settings to get the desired effect, it seemed only overlaponlypawn gave the best results. I’ll report back in a few hours with the findings.

Thank you very much for your time.

Collisions like sphere collisions don’t get hit by traces unless you set them to block everything.

Two questions: What trace are you using? by objects or by channel?

If you’re using by channel try to use by objects instead.

Second question: What’s the setting of your sphere? Could you try to set it to overlap all?

Because in either mode it shouldn’t be hit at all ever.

You can just check in the custom settings what it’s saying there. If overlaponlypawn has everything listed under “Ignore” and pawn as “overlap” it should work.

Can you try setting the trace debug to one frame or duration? To see what exactly it traces and what it hits?

Or even log / print what exact component you’re hitting. Because sounds rather weird.

“check in the custom settings what it’s saying there.”
It’s weird. It’s not only set to overlap pawn.

With collision preset set to OverlapOnlyPawn (Query Only, World Dynamic set and greyed out), collision responses are as follows:

Ignore: Camera

Overlap: WeaponTrig (a trace channel I added in an attempt to fix problem), Pawn, Vehicle, Player (custom object), weapon (custom object), Enemy (custom object)

Block: Visibility, WorldStatic, WorldDynamic, PhsicsBody, Destructible

In LineTraceByChannel node, Draw Debug Type set to “For one Frame”, take the Out Hit and Break Hit Result, Take the Hit Actor and run it to “get display name” and then print that. The child class BP of ItemBaseStaticBP, 's name is printing out. “StaticBatBP”.


“You can just check in the custom settings what it’s saying there. If overlaponlypawn has everything listed under “Ignore” and pawn as “overlap” it should work.”

Setting up a custom preset exactly as you stated, where only pawn is overlap and everything else “ignore”, it functions as desired. I guess I shouldn’t trust the custom preset name, and should instead only trust the collision response settings.

problem is as good as solved. Thank you very much, Erasio. I’ll keep in mind the points you mentioned.

Well there we have it. By channel traces for visibility. Since you block that you will get a trace hit. If you set that to ignore or overlap it should work.

I’m marking as answered on Erasio’s behalf. Thanks to Erasio’s help, provided in the comments, my issues were completely resolved. (I take no credit for the answer whatsoever.)

Erasio:

"You can just check in the custom settings what it’s saying there. If overlaponlypawn has everything listed under “Ignore” and pawn as “overlap” it should work.

Can you try setting the trace debug to one frame or duration? To see what exactly it traces and what it hits?

Or even log / print what exact component you’re hitting. Because sounds rather weird."

Me:

“Setting up a custom preset exactly as you stated, where only pawn is overlap and everything else “ignore”, it functions as desired. I guess I shouldn’t trust the custom preset name, and should instead only trust the collision response settings.”

Erasio:

“Well there we have it. By channel traces for visibility. Since you block that you will get a trace hit. If you set that to ignore or overlap it should work.”