Cast failed; Cast to HUD on trigger
Trigger volume is triggering just fine, but the Cast to HUD keeps failing. Am I using the Cast function correctly?
Intended function: On trigger volume overlap (when new area entered), the HUD should display the area and level's name (currently defined as a variable in the volume).
Current script flow as I see it looks like this: 1) Volume is triggered starting the overlap event in AreaTrigger. 2) AreaTrigger convert it's AreaName and LevelName enums to strings, then sends that info on over to HUD via a cast (maybe this is not how a Cast works?). 3) HUD prints the Strings in a Draw Text function.
Like I said, trigger volume triggers okay, however, cast always fails.
When I begin play, the HUD displays some test text and the default AreaName text. However, when I enter the volume, I only get 'Cast failed' and the HUD's text does not change.
I see you already fixed it, but just in case if you want something to cast to your hud it should be connected more like this :)
answered Feb 28 '16 at 03:13 AM
Fixed this; Removed the Cast function completely and stored the variables instead in a Blueprint Interface so I have 'Entered new area?', 'Level name', and 'Area name' in a callable function. I still have the Enums set on the trigger volume - these are sent to the interface which when used in the HUD gets me my variables! :) Below for pics!
answered Feb 28 '16 at 03:07 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here