To be honest I know perfectly what a cast is. When you have a reference to an object you have access to any variable and method of that object. If you create a class that inherit from an other class you can save the istance of child class as reference of the parent one. Obviously you can’t access to child class data unless you cast it as child. Ex: I create the class “fruit” and then from that class I create “apple”, “banana”, “pear” and “Batman” (that isn’t a fruit but I can so I will). I can use the “get all actor of class” node (input fruit class) to get an array with every reference at fruit objects I’ve in the scene. Now I can’t directly access to “BatCave” variable because the code can’t be sure you are reading Batman or a banana so i need to cast my fruits to Batman. If the cast work I’ve access to the bat cave and call “FightJoker” method, if the cast fail I can at least peel it.
The mistery is the warning: I’ve the item class and the Weapon class that is inherit from it, OBVIOUSLY I can cast the item class ref as weapon and the cast work (as you can see from the big gray arrow in the image) even if the warning tell me it should fail, so, why it warn me?
hmmm. so you created actor “Item class” and then created child bp “weapon in slot” from it? i tested it now, i casted hero_base to hero_sniper in my project and got no error… soo i dont have more ideas
btw i stopped using breakpoints because i played with debugging a lot and i found breakpoints themselves are buggy… im using only print strings