So I put two player start actors in my level and with a certain probability, upon joining the game, one player appears at PlayerStart1
and the other appears at PlayerStart2
.
However, sometimes I get this:
[2022.11.01-21.13.57:769][346]LogPhysics: Warning: UWorld::FindTeleportSpot called with an actor that is intersecting geometry. Failed to find new location likely due to actor's root component not being a collider component.
[2022.11.01-21.13.57:769][346]LogSpawn: Warning: SpawnActor failed because of collision at the spawn location [X=100.000 Y=-270.000 Z=100.000] for [BP_MyPawn_C]
[2022.11.01-21.13.57:770][346]LogGameMode: Warning: SpawnDefaultPawnAtTransform: Couldn't spawn Pawn of type BP_MyPawn_C at Rotation: Pitch 0.000000 Yaw 0.000000 Roll 0.000000
Translation: 100.000000 -270.000000 100.000000
Scale3D: 1.000000 1.000000 1.000000
I concluded that I need a “collider component” for Unreals default spawn mechanism to work. So I put a USphereComponent
(with appropriate radius) as my Pawn’s root.
Now I get this:
[2022.11.01-21.26.23:804][606]LogSpawn: Warning: SpawnActor failed because of collision at the spawn location [X=100.000 Y=-270.000 Z=100.000] for [BP_MyPawn_C]
[2022.11.01-21.26.23:804][606]LogGameMode: Warning: SpawnDefaultPawnAtTransform: Couldn't spawn Pawn of type BP_MyPawn_C at Rotation: Pitch 0.000000 Yaw 0.000000 Roll 0.000000
Translation: 100.000000 -270.000000 100.000000
Scale3D: 1.000000 1.000000 1.000000
[2022.11.01-21.26.23:805][606]LogTemp: Warning: BP_MyGameModeBase_C /Game/SomeLevel.SomeLevel:PersistentLevel.BP_MyGameModeBase_C_0: No pawn spawned.
Thus I got rid of the friendly advice regarding a collider component by putting a USphereComponent
at the root, but the spawning is still very much broken.
I am wondering now:
I could just overwrite GameMode::ChoosePlayerStart_Implementation
- the Unreal default for spawning isn’t very elegant. If I want to randomly spawn new players at a bunch of different start locations, I don’t know if any sort of collision checking is what I need (rather: mark Player Start as used/remove them).
But unreal provides me with some default and would like to get it to work once, before I start an implement my own stuff.
Note that I tried different version of the PlayerStart property “Spawn collision handling method”, but even “Always spawn, ignore collisions” produces the exact same errors. So this just seems disfunct.