From my understanding casting allows two blueprints to interact which each other when the node is hit, but I can’t seem to figure out what to put in to the object node. I’ve tried a few different things now and followed a couple tutorials that don’t seem to answer my question.
The Pickaxe actor has a boolean variable in it called IsSwinging, This is in my character blueprint, telling it to switch it to true upon click.
Cast To blueprint node used for casting same type to specfied.
As I’m understand in your case Pickaxe casting to “Pickaxe”. So you can check As Pickaxe value for validity. “Success” value gives the result of casting. You can use this in Branch node. (if Sccess then set IsSwinging value of Pickaxe to true).
Pickaxe variable may has type not necessary “Pickaxe” (in your case type name has same name with your variable, this is not good for for perception).
Also if your variable “Pickaxe” has type “Pickaxe” casting is not necessary.
Let’s say we have next hierarchy of objects:
Base object: Actor.
Derived from Actor: Adam and Eva (yeah, pretty stupid, but way more accessible).
Also there is an object called “Apple of Eden”.
We see two objects, Adam and Apple, but we only know them as Actors.
So we want Adam to eat the Apple and they are given us as Actors.
First of all Adam should pick up the Apple. Remember, we have Adam as Actor, and actor has no idea how to pick up the Apple.
So we using Cast: we trying to take given Actor as Adam, if it of course possible, and then we telling to Adam to pick up the Apple. And if cast failed, then we have Eva for some reason, or we tried to think that Apple is Adam. That’s all.
In deepness of engine core this actually forcefully reinterpreting given object as target type and checking for validity.