Lets say I want to create a object when my Level starts. Where would I do this?
Where are actually the PlayerCharacters created?
What if I want my PlayerCharacter to be created after a button click or something.
Right now I have no idea how I would do all these things, using the existing code.
Now on specific problem, UE4 has it’s own respawn system, you can set up default pawn (base class of character class, character is just extended pawn) for players:
If this system does not fit you need spawn player chatacter on BeginPlay() (every actor class have this event) using ()->SpawnActor(ASomeActor::StaticClass()); then you make playercontroller posses it. I think PlayerController is best place for such code.
Also heres link for gameplay framework documentation which you should find useful:
Is it recommended to use GameMode as Level start?
Let say I want to create a player and automatically add this player to a team or something or setting up a point system, should this be done in the GameMode?
GameMode class
{
..SpawnActor..
addPlayerToTeam(actor);
PointSystem pt;
}
If it’s somehow possible to get the spawned actor…
talking about the player controller.
In a lot of thread and tutorials I se this player controller.
My question is: Is this controller automatically created?
Or do I have to create it myself?
ok, found it in the Scene Outliner when I press “Play” in the editor. Seems like the Counter increases each time I hit “Play” (e.g PlayerController1 → PlayerController2 → PlayerController3)
Another question:
Went through some Links you’ve posted, but found no answer to this:
When I hit “Play” my default ue4 Character is created with this code: