Why does control of character is broken on new levels?

Hello. I’m getting a problem with created levels. My keyboard controls is pretty standart:


And it’s work well in old levels, but when i’m creating a level and trying to make some movement in it, something strange is happening: when W key is pressed character running to the right, A - up, S - left, D - down. The importang note - I have camera over the character:

and I have additional mouse controls (from top-down template):

But I don’t understand why is everything ok in old levels and is bad in “fresh” levels. I thought I should create BuildData of new map or delete nav mesh, but it doesn’t help.

Did you go to world settings → Game mode and configure it?

Nope, it’s empty
image

I’ve found a problem. My level BP looks like this


and the problem is in get actor transform for character spawn, if I’ll change it to get actor location:

everything will works fine. So the problem was in Spawn Transform Rotation. I shouldn’t use get actor transform.

Technically the issue is you aren’t setting the game mode. The GM defines the character, controller, game state, player state classes etc.

Additionally, You should be spawning the character from the Game mode.

2 Likes

Can you give me more information about this “Additionally, You should be spawning the character from the Game mode.”? Maybe tutorial or just additional details…
Update: Oh, I understand, you mean I should do it inside gamemode class.

Create a Game Mode class.

Under Class Defaults configure all your specific classes.
image

In the My Blueprint panel → Functions… Override GetDefaultPawnClassForController
This prevents the game mode from auto spawning a character, then possessing it. Thus giving you full control over the spawn/possess process.

In the Event Graph right click and search for Event OnPost Login.

Spawn your Character, then possess. (Delay isn’t needed)

For specific spawn coordinates you should create a function that returns either vector or transform.

1 Like

Thank you very much! It’ll help me.