Download

Dynamically add APlayerStart object during gameplay possible?

Hi, the game I am working on need dynamic APlayerStart object, I would like to attach APlayerStart to an static actor that do specific things.

For example, the team start in a base, the base have Spawn around, start with few and during the game it can increase, also players can add base in the map which add new spawns, so basically it dynamic. What I want is the base (actor) manage the spawn around it, and add/remove spawn when needed, since player can add other base everywhere, it can generate new spawn location, so basicacly I cannot use static spawn in a map. Also player can decide in which base he want to spawn.

I was doing something similar to that on Source long time ago, I suppose it is possible to do the same, but I dont know how to attach a APlayerStart to an actor or if it is possible to do it, I am not an UE4 expert so far but I will be soon :).

So my main objective is to call GameMode->FindPlayerStart_Implementation(Player, PlayerStartTag);
to spawn a player to the APlayerStart I want.

Any help would be appreciated!

Thank you!

I will try this
PlayerStart = World->SpawnActor<AActor>( APlayerStart::StaticClass(), FVector::ZeroVector, FRotator::ZeroRotator, SpawnInfo );

I just discover this, it is probably the way to go for me!