Hello, i have a problem with my blueprint scripting. I cannot use Get Control to take control from character or pawn, auto possess is set to default, also my gamemode is already set but still not work, the character or pawn cannot move. But when use Get Player Control, it worked again.
Hi @PicoPhan!
So to be clear, GetController needs a target. You have to tell it what the target is, “Self” is okay as long as your code is on the pawn whose controller you’re trying to get a reference to.
GetPlayerController, on the other hand, finds the controller with that player index and returns it anywhere.
That probably has some bearing on your issue. You may have accidentally unassigned the player’s “PlayerController” actor variable on the player’s character blueprint! Make sure that is set or it will receive an AI controller on spawn!
i don’t clearly understand your answer, i just want this character moving with WASD, i can control it if i used GetPlayerController, GetController not worked on it. Sorry bc im new to this.
Okay, let’s see if I can clarify.
A controller is an object that is attached to the actor. It can be an AI controller or a player controller. It determines what an AI does, or buttons do what.
A PlayerController is a controller that is assigned to a player interface.
GetController takes an input- it needs an actor to search and it returns the controller object that the actor has.
GetPlayerController searches the program for the player with a #'d interface, for one player it would be 0, and it returns the controller that the player is currently using.
But long story short, GetController isn’t supposed to work for what you’re trying- you need GetPlayerController. They are very different and have different uses
Hey @PicoPhan! If any of this helped, don’t forget to mark a solution for others who may come along and have the same issue!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.