Why is this cast failing?

How do I correct it?

Casting works in the sense you have to ‘cast from in order to cast to.’ In the attachment you gave us, your attempting to ‘Cast to’ ThirdPersonCharacter and “Figure out it’s damage.” In order to ‘Cast To’ ThirdPersonCharacter, you need to ‘Cast From’ a node that has some relation to what you are trying to ‘Cast To.’ Your example shows you are attempting to **‘Cast To’ **ThirdPersonCharacter by ‘Casting From’ (Object) Self. You cannot do that because ‘Self’ is referencing the ‘Explosion Projectile’ since you are writing this blueprint code in the ‘Explosion Projectile’ Blueprint; you need to ‘Cast From’ something that has a relation to the ThirdPersonCharacter.

In the picture below, I’m in my game’s ‘Player Character’ Blueprint (for you this would be your Explosion Projectile Blueprint). I’m using a ‘Get Player Character’ node and **‘Casting from’ (object) **in order to **‘Cast to’ **EnemyRobot’ (EnemyRobot is your ThirdPersonCharacter) which is allowing me to call ‘Set Test Variable’ from the EnemyRobot. Now I know what you are thinking, why would I need to reference ‘Get Player Character’ in order to cast to the EnemyRobot? Because even though the Player Character and EnemyRobot are two totally different characters, they both share one thing–they are a character (remember, you have to **‘Cast From’ **using a node that can relate to what you are trying to ‘Cast To’) and the ‘get player character’ node is the closest thing you can use to relate the both of them since a simple ‘get character’ node doesn’t exist (I’m sure there is a reason, or maybe I just don’t know about it if there is).

Documentation: Casting in Blueprints | Unreal Engine Documentation


Here’s a documentation link for more information:

I’ve noticed you have like ten different threads started which all revolve around Cast To nodes failing because your using the wrong nodes to connect to the Object pin. I want to clarify something for you on this, it doesn’t matter what Blueprint you are in (actor, level, etc.) what I explained applies to ALL Blueprints. So if you are working in the Level Blueprint and need to Cast To the ThirdPersonCharacter then you use the ‘Get Player Character’ node as the Object. If you are in a projectile blueprint Casting To ThirdPersonCharacter you will still use the ‘Get Player Character’ node as the Object. Even for a third example, if you are in the ThirdpersonCharacter Blueprint and need to Cast To the Player Character, you STILL use ‘Get Player Character’ as the Object. The rules applies when Casting From and Casting To controllers, etc. The same rules apply.

Wish I could use Unreal right now, I want to prototype something real quick to see if it works! Gah…

Why can’t you use it right now? :frowning:

It’s installed, but this laptop (for work) runs SO SLOW that by the time I load up the Engine, it will be time to go home.

I used to play around with the engine a little bit while I sit here, but now it’s not really worth it because of the frustratingly long time it takes. I downloaded 4.9 faster than it took to verify the installation, like 3x faster. And that was yesterday, on a crappy WiFi connection. The type of WiFi connection where it would usually take YouTube a minute to start playing a video.

Aw, that’s no fun. If only Unreal Engine was on the cloud so you could just work remotely from using some setup like Digital Ocean or something. Private VPS’ that just run UE4 haha.