Overlap Event for ONLY Specific Component of Actor

Hello, thanks in advance to anyone who can offer help on this!

I am scripting a small object-placing mini game (basically placing cogs in the right places on a machine to activate it) and in short I need to get a trigger (which is a component of the ‘machine’) to recognise overlap with only a specified component that exists within another actor (i.e. a trigger inside the correct cog’s BP).

I have the overlap event working for all actors excluding the player, so if you place any cog on any of the available ports, the overlap will be triggered. This also happens if any part of the cog is touching, and I want it to be based on just the centre hole of each cog (hence the trigger). I just need to be able to specify one component for the overlap to work for.

I’ve tried casting and calling in every way I can think of to call this trigger component and it never works, any advice would be greatly appreciated!

Thanks

If you generate a hit, the hit includes which component you hit.

There are multiple ways to fix this:

  1. Change the collision settings of the “center hole” component to something that is not used by the other components in the cog, and make your trigger only detect that type of collision. This is the cleaner and more robust method. You can create a new collision channel if needed. Some documentation on collision filtering: Collision Filtering - Unreal Engine
  2. You can add a tag to the “center hole” component, and on overlap with your trigger, get the component tag (from the “Other Comp” output of the overlap node) and check that it’s what you want, and only continue if it’s the correct tag.
1 Like

Having a similar issue myself, I have vehicles moving along a spline and I was hoping to use a box overlapping event to initiate indicators on the vehicles when they reach a certain point along the spline. However, once one vehicle overlaps the trigger box, it seems to initiate the indicators on all the vehicles in my scene. Been stuck for awhile now trying to make the overlap box just work on whichever component is currently overlapping it. Any help would be much appreciated!

Having a similar issue myself, I have vehicles moving along a spline and I was hoping to use a box overlapping event to initiate indicators on the vehicles when they reach a certain point along the spline. However, once one vehicle overlaps the trigger box, it seems to initiate the indicators on all the vehicles in my scene. Been stuck for awhile now trying to make the overlap box just work on whichever component is currently overlapping it. Any help would be much appreciated!