Download

PlayerStart not spawning Pawn with custom Object Type

Hey all,

So let me precede this with an obligatory disclaimer. I know I can jump into my level or mode and do some spawning logic myself. However, I am very curious why this is happening, as I’d really like to do things in a manner that is not “against the grain”.

That said, I’m running into a strange roadblock (could be expected behavior). If I change the object type on my pawn’s mesh to a custom type, the player start will no longer automatically spawn my pawn and possess it. For a super quick, easy example, one could:

  • Start a new Twin Stick Shooter project (4.24).
  • In Project Settings > Collision, add a new object type named “PlayerPawn” and a new preset named “PlayerPawn” which matches “Pawn” exactly other than “Object Type” being “PlayerPawn”.
  • In TwinStickPawn, change the mesh’s collision preset to “PlayerPawn”.
  • Observe that nothing spawns when you Play in Editor.
  • Change the mesh’s collision to WorldDynamic, it works just fine.

The question is, why is this happening? Is this intended?

Explanation of intent:

I’m looking to set the player’s pawn to PlayerPawn, and player’s projectiles to PlayerProjectile. This would be the easiest (and seemingly, most performant) method to make enemy projectiles ignore other enemies and player projectiles ignore eachother. This way, there is never an event fired for enemy projectiles overlapping with enemies (etc).

I know I can just do nothing in the event that an enemy projectile collides with an enemy, etc. I’m not necessarily looking for answers as to how to work around this issue, I’m just hoping that someone knows the nitty gritty as to why the pawn does not spawn with my custom object type defined on the mesh. It does not seem like it’d be intended behavior to me, but I don’t know.

The player start does nothing. It’s just a position marker.

For whatever project type you make, there will be a default pawn of the appropriate type placed in the world ready.

When you want to change the way things work, you might get rid of that pawn and put your own pawn in there.

So, remove the pawn from the map and place your own pawn in ( or spawn it at run time ).

I’m aware that I can do a virtually infinite number of things to spawn a pawn. I’m just curious why the engine no longer automatically spawns this same pawn based solely on the object type of a static mesh within it. I guess I can step through the methods to see if it is explicitly requiring default object types, but I had hoped someone would’ve already done it (or read somewhere).

It is colliding with the Pawn object when trying to spawn. If you set the “SpawnCollisionHandlingMethod” to something other than “don’t spawn if colliding” it should work.

Thank you! Was trying to play with 2 characters on my game and it wasn’t spawning the second character.