Why is my casting failed?
What is the parent class of the PW_Character - you can check it in the upper right corner.
Hello, PW_Character’s parent class is Character
Have you tried Get Pawn Owner or Get Player Pawn?
Is there a PW_Character possessed by the player on your level? If you spawn your player from a PlayerStart, check the gamemode if you have the correct character selected
I just want to say to everyone, thank you for taking the time in looking into my problems and trying to help me.
I intended to make this game semi RTS where I can control multiple characters. Right now I can click and drag PW_Character blueprints into the level as many times as I want and I am able to click and move them one by one. There is no PlayerStart on my level. I just clicked and dragged the PW_Character blueprint to the level, I suspect that’s the root cause of my problem. Do you have any suggestions how to continue and be able to cast PW_Character in the PW_AiController or in any blueprints for that matter?
Ah I see it now, so i guess your PW_Character is controlled by the PW_AiControlller
If so, use a get reference to self node, drag a get controlled pawn from that, and use this instead of the get player character.
It should work
Thanks a bunch! Now it works!!!