Casting to another blueprint in the widget visibility graph
I have set up a system that will display a widget dependent on a variable. If the variable returns true, the widget will become visible, and if the variable returns false the widget will become hidden. This system works perfectly when I am referencing to the Third Person Character as casting is very simple with the third person character. (I can just use get player character for the object):
The issue I am experiencing is when I cast to a different blueprint other than the third person character. For example an actor, the widget will remain visible (which is it's default state) meaning that it doesn't recognize whatever I am casting to the blueprint variable so it can't return true or false. I'm not sure how to cast to another blueprint, and non of the tutorials online have been helpful unfortunately. This is a picture of the blueprint I am using:
Any help would be appreciated, thanks!
asked Jun 03 '18 at 08:21 PM in Blueprint Scripting
You need a reference to the object you are "casting" to. So in your case "WoodInventPickUp" needs to have something fed into the object pin hence the error. Your cast will always fail the way you have it set up. Use an overlap or hit event or other such event to get the reference to the "WoodInventPickUp" and you should be fine.
answered Jun 03 '18 at 10:00 PM
Nebula Games Inc
Follow this question
Once you sign in you will be able to subscribe for any updates here