How to Cast To Widget and Actor Classes?


I need to Cast To My Widget for a Custom Event. I know another way but I want to know the solution for this:


What goes to object for Widgets?

And when I want to cast to an Actor I have the same problem


What goes to object

When you use node “create widget”, output “return” is what you have connect to cast node input “object”… did you mean this?
Its same with actor…

This is already created in HUD. Now I need to cast it in the Player Blueprint. Without something connectet to object it doesnt work… For example if you cast to a character then get player character goes to object.

so if i correctly understand, then you can try to call event from player to HUD and in HUD run logic for you widget. In player BP -> get hud -> cast to your hud -> call event which will do something with wiget

it works! thanks! so I just need to now how it works for actors! I need variables from different actors so I need to know how to cast to them. I would really appreciate it!

Just for prosperity…

I made a custom event node in my widget to play an animation. Having a hard time finding the target ‘object’ in cast to event.
Used a ‘Get all widgets of class’ node before the custom event node. Plugged ‘found widgets’ into the object.

Prosperity? Live long and prosper?
Maybe you meant Posterity…

Either way casts are by nature very temperamental. Often times they even invalidate on object renames.

Lol, you got me. English is my native language. (Oh that’s bad, I shouldn’t admit it)

Don’t worry, I only catch these because English is NOT my native language :stuck_out_tongue: