Download

Why is this cast failing?


It is the one link that breaks the whole system, I have no idea why it fails either. It used to work, and then randomly it just… stopped…? every time I fire the “Selected” event, it breaks the exec flow and prints “hello” which means it failed the cast. No errors or anything. This is being cast from the player pawn to the UI widget. The player being called BPPlayerCharacter, and the UI being called UIwidgetBP.

The compiler tells you at the bottom that you do not need to cast. Get All returns a correct type already. A cast here could fail because there are no widgets of the specified class to be found.

I already solved it, the event was firing WAYYYY before the UI was able to be created, so it was looking at nothing and then not outputting any noticeable errors.