Download

Get around "Cast to"

Hey you guys,
any ideas how to get around the “cast to”?
Thanks in advance! :slight_smile:

Hey,
you could use “GetComponentByClass”, that should work fine.

Thank you! I´ll try it later and say if it worked :slight_smile:

OK… but how do I integrate it? Sorry for asking it :I Clould you write it down like this or something:

Event Construct -> Cast to Sedan -> set Level component
Get player Character -> -> Target: Levelling ->

Sorry if I sound selfish or something :I

GetPlayerCharacter gets a reference to the Character you possess (if any)
Your Sedan class is probably not a Character and therefore you get a warning that it will always fail to cast.

You should learn more about Blueprint communication to figure out the different communication options.

If Sedan is a Pawn you should use GetPlayerPawn instead.

That big yellow warning box means you don’t need to cast it…

Yes I should learn more… :smiley:
I use the premade Sedan Game.
And, I tried, the Player Pawn also doesn´t work… any more ideas? :I

But how do I make it then?

Wait sorry I´m dumb… yes it works with player pawn. Thanks a lot everyone! :slight_smile: