I’m fairly new to unreal engine and have come to really it. A lot of systems seem very natural and intuitive. There’s just one thing I can’t really wrap my head around. Its not the nature of casting or what it does and why it does it. instead, it’s simply these two cast to functions that I’m having a lot of trouble with.
The main purpose of this blueprint here is to set a sprite, that is attached to an actor, to hidden if no trace is blocked, and to not be hidden if a trace is blocked. I know the trace is working since the “PrintString” function is printing whatever object it hits on screen.
I have two returns from by branch that lead to the casts. True for if the ray trace is blocked, and false if it is not. The true adds the “Hit actor” to an array and continues onto the “Cast to HookPointUI”, which is one of the two casts I’m having trouble with. If it is false it continues onto a “ForEachLoop” that completes one “Cast To” function and then clears the array.
The problem is that both “Cast To” functions aren’t working. I’ve set the trace channel of the “LineTraceByChannel” function to be “HookPointUI”, which is something directly related to the “Cast To HookPointUI”. Both the target and the object reference are actors or have parent actors.
Can someone help? I’ve no idea what the problem is. It’s probably something plain as day that I haven’t, just yet, wrapped my head around.