Download

Spawned pawns have no physics or anything

Hello all, I have some code on level start that spawns a number of pawns on the map that the player can then press a button to posess.

When the pawns spawn, they seem to spawn static. They float in the air at the target spawn points, and never get physics applied.

I can possess the characters, as my camera shifts to theirs and my input works (Its a 2d game, so when I press left/right it just rotates the character for movement. I see the rotation happening as I press the buttons) but nothing else works. My jump animation is set to play when the character is falling, but its not showing, so the pawn has no velocity whatsoever.

Did I miss a step during the spawn process that “Activates” the character per se? I know my movement works, as I tested all of the blueprints manually before I did the spawn code and they work great.

Any help is greatly appreciated.

Fixed my own issue. For reference for others who may encounter the issue:

I rewrote my spawn code to use UE4s default spawn mechanics and some tweaks to default player class and the issue still persisted. What I eventually found as the problem as that I was setting my player physics vars as shown below in my custom class the blueprint is based off of.



	GetCharacterMovement()->GravityScale = PlayerGravityScale;
	GetCharacterMovement()->AirControl = PlayerAirControl;
	GetCharacterMovement()->JumpZVelocity = PlayerJumpZVelocity;
	GetCharacterMovement()->GroundFriction = PlayerGroundFriction;
	GetCharacterMovement()->MaxWalkSpeed = PlayerMaxWalkSpeed;
	GetCharacterMovement()->MaxFlySpeed = PlayerMaxFlySpeed;
	GetCharacterMovement()->Buoyancy = PlayerBouyancy;


The player vars were set in the blueprint in the editor. The reason it was breaking is I had the above lines of code in the constructor, so it was setting the vars before the blueprint even existed. Once I moved it to begin play, everything was perfect.

TL/DR: Make sure vars that use blueprint settings are set not in the constructor, but in begin play.