I´m trying to cast to an actor inside a widget button so I can toggle the visibility of a specific part of the actor itself. The problem is that I don´t know what I have o put on the object node to make the cast work.
Asked
Active
Viewed 8,716 times
-1
-
"Cranio" is the name of the actor – Sergio Nani Mar 04 '20 at 19:40
-
It's not possible to answer without understanding more about what you're trying to do. Where is this actor? How did you plan to get a reference to it? – Rotem Mar 04 '20 at 20:50
-
I´m sorry, I´m new to UE4. I want to toggle the visibility of a specific component inside an actor. I want to do this action by clicking in a button on a widget The actor itself will be spawned on the map by clicking a button. – Sergio Nani Mar 04 '20 at 21:49
-
I know that this can be done because I saw a video of Zak Parrish from Unreal doing something similar, but I can't find it – Sergio Nani Mar 04 '20 at 21:57
-
1When you spawn the actor, keep a reference to it in a variable. – Rotem Mar 04 '20 at 22:18
-
Thanks! That actually worked, but I do know there is an easy way if I find it I´ll post it here. https://imgur.com/5EqHj24 – Sergio Nani Mar 04 '20 at 22:53
1 Answers
1
You can do "get all actors of class" before casting, select the actor you want "Cranio" then from the array square output from "get all actors from class" drag out a "Get (copy)" and connect its output with "object" in the "cast to Cranio".
Look at the image to visualize.

Ali107
- 21
- 8