Download

Please explain "cast to" in Tappy chicken.

Can someone please explain to me how the “cast to” function with the gamemanager actor works in Tappy Chicken. I’m very new to this and would like a better understanding on what’s going on with them. If not, just a good explanation of what “cast to” does.

I don’t know what specific cast you are talking about but generally a cast does is to check if an object is of a specific type. In programming you have up and down casts. Lets say you have a blueprint “Box” and two other blueprints “Red Box” and “Blue Box” which both derives from the “Box” Blueprint. if you get yourself an array of all “Box”’ Objects in the Level you could do a “Cast To Blue Box”. If the cast was successfull you have a BlueBox. Otherwise it was a red box.

I’m not sure how how inheritance works in blueprints but it could be that if you have an array of “Box” Objects that you only have access to variables and functions of the Box Blueprint. To actually get access to the Variables of “Blue Box” or “Red Box” you need to cast to… But that’s not sure…I have to test that myself.