Casting character fails

Hi,

why is my casting to character in PlayerController always fails? Weird thing is that I don´t have any warnings or errors after compile. Yes as object I am using Get Player Character. I thinking if the problem is not in that I am trying to Cast Character inside Controller (but I am not sure). Am I using just bad object or is problem somewhere else?.

Thanks lot for help.

ps. I can provide screenshots but those blueprints are littlebit bigger and there is not just one, so I would be happy to get help just by words but I can provide them if needed :slight_smile:

It’s hard to tell exactly what the situation is from what you wrote.

I’d make sure to check that your cast is to “your player character name” and I’d also check what object the GetPlayerCharacter node is returning

cast is to correct cahracter, how can I check it what it returns?

You can use your mouse to hover over the output pin.

Also it would probably help a lot to see an image or video

problem is before selected PrintString (debug) on picture cast-1, outher pictures are just functions and input function

Have you tried “get player pawn”, I don’t know what your class inherits from, it may not be the player character base class

Does the GetControlledPawn node in your picture also make it fail? Like Nebula said, we don’t know what your character inherits from, and so far it seems like it’s an inheritance issue.

Casting will only work if your “CH_WareHouser_CHAR” is a child of “Character”.

I´ve tried (it weas first thing which was there but it doesn´t work at all), CH_WareHouse_Char is normal Chartacter blueprint so it should or not? Originaly it was Pawn but I need Character Movement componenets and other things which are in Character Blueprint. Character looks like this or his blueprint

I’m a bit puzzled, if you are in your custom Player Controller… Get Player Pawn, Get Player Character, and Get Controlled Pawn should work… sorry, I don’t have an answer…

Just a side thought from looking at your BP though… once you have the cast working… do just ONE cast in BeginPlay and assign the result to a “Player Character” variable. It is more efficient than casting each time you need a reference on Tick

yeah but when I don´t have working cast then it´s for nothing basicaly… :confused: if you want I can upload my project to Google drive for example and send it to you so you can look on it on you PC :smiley: :slight_smile:

ok I found it, I had bad world settings for default Pawn Class, but I still have problem character turns, but I can´t move