triggering off a trace impact

Hey i want to fire a trace from one blueprint, and in another blueprint i want to detect that trace impacting and trigger some logic off of it.

eg im firing a trace at blueprint of a wall from my character blueprint, the wall has some logic in it that will change its colors if it receives the correct type of impact.

I’ve tried doing this with projectiles and surface types , but i cant seem to get that working and that seems a bit overkill. anyone got any tips please?


You need the player to tell the wall to change color, objects do not know when a trace collides with them. Inside the character, cast the hit actor to the wall BP, and if that works, you can modify it, or fire a Custom Event on it. I’ll be doing a video tutorial of this later in the week!

Would love to know more about this casting system, no idea how it works, so i look forward to your video. I assume with that i can communicate with a specific instance? Cheers

You could also just use an interface message to send an event to whatever the trace hits every tick. Say your interface is Called LookingAtInterface and the event you want to use is called BeingLookedAt, then on anything that you want to be able to look at, implement this LookingAtInterface. Then you should be able to get the BeingLookedAt event, and do what you want with it.

I have done something similar to this in the past, for simulating mouse over events. You will also want to add some logic to track what you are you are currently looking, and what you last looked at, and each each tick test what you are currently looking at against what you looked at last, if they don’t match then send a NotBeingLookedAt to the thing you looked at last, and BeingLookedAt to the thing you are looking at this tick. Then, after that you would set what you last looked at to what you are currently looking at.

If what you are currently looking at = what you last looked at, you wouldn’t need to do anything, because you would have already sent the message to it.

I know that might sound a bit confusing :wink: