I can’t seem to figure out how to get my ray cast system to differ between two actors. Basically whats happening is the ray cast set’s an actor variable called Actor Traced. This Actor Traced variable is then casted against BP_MasterItem and if it is a child of that blueprint then promote to a variable called Master Item.
So 2 Variables. Actor Traced – and – Master Item.
Once this Master Item is set, we then get the information associated with that blueprint from a Data Structure I made, (S_ItemData) then we break the structure and get the Item Name. If the Item has a name that is not null then set item text. My HUD blueprint then picks it up from there. In my HUD blueprint my Item Name text gets set to that of the Item that was traced. So Now Actor Traced > sets Master Item > Gets Item Name > HUD sets Item to same as Master Items, Item Data.
Then we again check to make sure Item Name (HUD) is not null, if this is true then we set Render Custom Depth on the Master Items Primitive Component (Mesh), if this is null then we set the Render Custom Depth to false.
Again this all works Great, but problem is When I set Actor Traced, and it checks against my Cast, and is confirmed, it sets the Render Custom Depth. I need to figure out a way that when I set render custom depth on an object, there isn’t already an object being rendered. Is there a way to do this?
By the way all of these are on Event Tick Events.
First Person Blueprint - Trace Item Function Part 1
First Person Blueprint - Trace Item Function Part 2
HUD Blueprint - Set Visibilities Part 1
HUD Blueprint - Set Visibilities Part 2
Here’s a video link of what I am experiencing.