Download

Yet another Casting problem

Hi everyone,

I’m trying now for hours to cast to my BP without any success. Hope you can help.

I have a character class “0_Base” and try to cast to an actor class “BP_Rotator”. Whatever Object I connect to the cast note “Cast To BP_Rotator” in my 0_Base BP fails.

I tried: GetOwner, GetParentActor that just fails because the variable I’m setting is empty.

GetPlayerController and GetPlayerCharacter gives me a warning “…Does not inherit from…”

I got the point that my cast has to know what object I’m referring to, but I really struggle with what the object is in some cases.

We do better with screenshots and videos. Please show the problem.

No problem. The whole game is based on the Unreal Multiplayer Tutorial. I just created a new map and created the “BP_Rotator” which is in my scene.

Here my two BPs:

You should read up what casting in an object oriented paradigm means.

Yes of course. Thanks!!!

I solved the same issue month ago and it also took me hours to figure that out. Got off track with the cast note. I just forgot to choose the Default value (BP_Rotator) for “0_Base” character in the details panel. This is such an annoying Engine implementation and not intuitive whatsoever!

Here the tutorial for everyone else: Direct Blueprint Communications | Unreal Engine Documentation

This only works if I drag my character into the scene because only than I have the details panel. How can I do the same if I work with "PlayerStart"s? In this case I can’t set the default value.