Hello Forums,
I got this code and am trying to get the widget object from a widget component.
However this cast always fails and if i try to print the object Name the Get user widget object node is getting, it returns none…
Is this widget that you try to “cast to” not in the same Enemy base bp ? If so you don’t even need to cast to it and can remove this node from there.
Just tried that. I can`t interact with variables in the widget without casting to the specific Blueprint class.
You could try this instead of the cast to node if it fails to access the variables.
But maybe your event beginn play fails to cast to the widget because the widget is not yet created. How is this widget set up ? You could awso try to communicate with an interface to the widget is another possible solution.
Does this only get the component in the blueprint? Because i have multiple of these running around at the same time.
I´m gonna try to provide more context here. I´m using this inside of a parent blueprint for all my different enemy types. I use the widget component to print a widget with the floating health bar above all enemies (W_FloatingHP). I followed a tutorial for this actually and it worked before i put it into a parent class. Now when i spawn one of the children it fails to cast to the blueprint.
hi,could you post a screenshot of one of the children class?just like the way you do with parent class screenshot
So the issue was that the children didn´t have the widget set in the widget component. I never changed this but once i reset it to default it worked again. Thanks alot for helping me if you didn´t ask for a screenshot of the children this probably wouldn´t have crossed my mind because i assumed it would be inherited correctly.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.