Before I start: If anyone more experienced wouldn’t mind sharing, is there any drawback to using this method versus traditional casting or interfaces? Because I’ve found this extremely effective and have been unable to cast to certain things, so I found a way around needing to cast at all and instead I now use Material Paramater Collections instead.
I come offering a solution for those like me. I couldn’t find, for the life of me, how to cast to a specific object in my scene. In my case, it was the directional light. I’d cast to actors then try going down the heirarchy towards directional lights, and be told that I needed to cast from the directional light to the directional light. Well, that can’t be done as far as I can tell because it’s a reference to self.
Or I’d have the opposite problem and only be able to try to cast in reverse, which, lacking inheritance, obviously did not work.
So I discovered Material Paramater Collections can be used as Blueprint variable passages. Since then, they have changed my life in a single night. Video below demonstrating their use in communicating between 3 blueprints, passing variables from a weather controller actor blueprint to a directional light in the persistent level while also updating master materials parameters all at the same time, without having to “castto” a single time.
I’m a new developer and either self taught or learned from the internet, so I do not know if this is bad practice in some unforeseen way. But I do know, if you can’t find ANY way to execute a given task, that is worse than finding a convenient way that works and later, when you have more experience, coming back and resolving potential issues you created for yourself when you were newer. Better to move forward and continue to learn and experience than get stuck trying to learn how to cast to specific actors when the modules seem to be sending you in circles.
Also, I find this workflow personally quite enjoyable and powerful.