What's wrong with my "constains string" branch

I’ve set up code that gets the display name of the hit component which then checks if the component contains a chosen substring, which in my case I’ve put “Projectile_Base” which is the name of my Projectile Blueprint. This results to a bool output which I connected to a branch. But whenever my projectile is hitting the Mesh, It still outputs as false even though it is the right component that hit the mesh.

What do you get when you Print Display Name on Hit?


Also string comparisons are, like, the slowest filters that are also prone to errors (because typing is hard).

The Display Name is not supposed to be a gameplay thing - it’s a debug feature. They’re not too reliable:


Perhaps you could use tags for this, works with inheritance and ready to go:

Tags can be granted and removed dynamically, too. Imagine setting an arrow on fire (give it fire tag) but it’s raining (take fire tag away), but it’s holy rain (give it holy tag).

Alternatively, you could also Cast To the component class - it’s loaded anyway. I bet it’d more efficient than string comparison.

I changed it all up, by using an overlap event, which works fine.

343401-jashdashdsa.png

But thanks for your help, didn’t know that “display name” was more of a debug tool :slight_smile: