Why does my player character fall through floor when first spawned?

Im spawning my character at check point location around the map. Every time I enter the level, my character spawn at the first location, falls through the floor then spawn at the checkpoint lasted saved. Why? And how to I fix this?

Any help is appreciated, thanks

Also im not using player start at level but the gamemode has my character input, if that has anything to do with the problem

its better to show code for these type of questions but a few possibilities,

its possible the character spawns before the ground and falls through (try a delay)

if spawning make sure its set to (TryToAdjust but always spawn)

if its SetActorLocation try add 200 to the Z since you could be spawning inside the ground and falling though

another option is to disable movement until you’re ready to play so it cant fall

1 Like

Hey there @ddave104! Since you mention you aren’t using player starts, how are you handling the player position? If there is a collision issue then they may fall through regardless, and if you teleport/set location the character partially obstructed they will also fall through the object that they spawn inside of.

I have the same question as Auran, can we see how you’re handling the spawning?

1 Like

On initial join the map isn’t fully loaded. So no floor, there’s no collision to stop the character from falling.

Ensure the floor is loaded before you spawn, or default the characters movement mode to None on spawn. Then when the floor is loaded set movement mode to falling.

1 Like

The Disable Movement work with falling through the ground, but im still having problems with the character spawning at the first location then moving over to the checkpoint saved location.

Here is the code im using on the game level, it’s in part from better picture. It starts the same but them mores to 3 different saving options, each time one spawns in the middle of map then the spawned saved location

I had a simillar problem, just not falling through the map. My issue is that it was spawning in a place it shouldn’t so I created a checkpoint even in the beginning of the map, and set it as default transform vector or something, which would change only if I would pass from another one.

1 Like

Assuming your collisions are set up appropriately, SetWorldTransform is fine here for the most part. This is a long shot, but what happens if you disable the teleport flag does the reaction change? The teleport flag retains velocity, so it’s possible that the actor is moving too quickly (thus never making contact) and falling through the ground if the player is falling for some time beforehand.

You could also place a breakpoint on the spawning to see where the player begins for sure and step through, then one on a collision check.

1 Like

Collision are set, I disable the teleport flag and the same thing happened, also placed a checkpoint in the beginning of the game, same thing.

I did do some testing and found that the player spawn exactly at X=0,Y=0,Z=0.

So something is spawning the player there first then moving it to spawn point. But i don’t know what. I tryed using the spawn actor Node, but everytime, no matter the location I plug in, player goes straight to 0,0,0.

if you have a default pawn set in the gamemode it could be auto spawning

1 Like

As Auran mentioned, the GameMode decides what default pawn is created when the game starts. If there is no PlayerStart, it will always begin at world origin 0,0,0. If the player character has auto-possession on in it’s details, you may be possessing the one spawned by the GM and not the one you spawned manually.

1 Like

I remove the default pawn class, and the player spawn under the make in first person view, then I change it to default pawn and the same thing

There is nothing in the game mode the spawns the player.

Unreals GameMode handles spawning the player controllers pawn / character. You can override HandleStartingNewPLayer() and SpawnDefaultPawnFor() to handle spawning at the correct location.

You could even just override find player start. If the only issue you have is it spawning at the wrong location.

Nope tried everything nothing working

Try my solution.

Create a small volume where you want the player to spawn in the beginning. Get the transform vector and set the spawn of the player on it. It should work, because somehow you are “overriding” the spawn location.

1 Like

-Ok, so I place one of the checkpoint at the very beginning of the game.(checkpoint saved player location). Then in the game level where I spawn the character at the beginning changed the location to get that very spot.

The character still spawn at the first location then at the checkpoint location. No change

-I then decided to try putting in a player start to the game level. If the player start is far enough from first spawn player spawn there (A) then moves to correct location (B). But if the player start is close by first spawn(A), it’s the same as before.

I don’t know If that means anything. Some how the spawn has been override in the level.

-I also made a new gamemode thinking that can be it, the same thing happened.

I suppose it could be a lot of things. The character may be down to far in the Z. You could try making a simple actor bp with a cube’. Place it in the world and scale and position it appropriately to where you know it should be under the character.

1 Like

Can you post a picture with the coordinates of the player start in your map and from the location where you want to start?

1 Like

I want the player to start at -70,-150,90. But, it starts at 0,0,0. If I place the Player Start Instance, the player start there, then teleports to -70,-150,90.

I was thinking about moving the whole map to get there and it would help but only for the start of the game. When the player hits a checkpoint, turns off the game and starts the game. The player spawn at the beginning then teleports to the checkpoint.