First person template: WASD movement

Hi!

I’m using Unreal 5.2.1, and I created a project using the First person template.

In the game I have two levels, one of the is the main menu. If I test the second level, I can move the camera with WASD, but, If I enter into this second level from the main menu (with Blueprint OpenLevel), I can’t move the camera.

How can I fix this problem?

Thanks.

Did you set the game mode correctly in that level? ( world settings ).

Each level has its own Game Mode. And it’s set in both levels.

Ok, it could be player start is not high enough.

Is the player coming from the game mode, or have you put them in the level, or are you spawning them?

The player start is a (0, 0, 100).

This is the Game Mode for the Main Menu:

And, this is the game mode for the other level:

Both are set to its level.

I don’t know if the player comes from the game mode, and I don’t put it in the level or spawning. I’m using the WASD to move the camera.

When I run the second level, I see this in the editor:

There is a third level, with a third game mode and player controller, without this issue: if I open it from the main menu or directly, I can use WASD.

Finally, this is how I open the level:

Thanks.

Ok, so making the game mode for both levels the same should fix it then?

No, it doesn’t fix anything.

The only different is that the second level is an empty level, and the third level is a Basic level.

Well, if you’re placing the player, or spawning it, it comes from the game mode, and goes at the player start.

So both levels should be the same :slight_smile:

Maybe, the keyboard is disabled.

I have this input action, and nothing happens when I press the N key.

How can I know if the keyboard is enabled or not?

Just press N, I guess. Everything should be the same as if you run the level in the editor.

I press N and nothing happens.

Have you run the level from the editor?

I think I have found why it is not working.

Here is a summary of the problem:

I have created a project using the FPS C++ template.

  1. If I open Level01.map in the editor I can move the character with WASD. Here, I see this in the Outliner:

  1. If I open the LevelMenu.map, and open the Level01.map from it I can’t move the character with WASD. I can use the mouse to rotate the camera, but I can’t move it.

There is a button on the menu, when I click it I open Level01.map with Open Level (by Name):

In this case, this is what I see in the Outliner:

The only difference is that there is NO Player Start. But, if I add a Player Start to the level01.map, I can’t move the character with WASD in both cases.

In addition, I’ve debugged the C++ and, in both cases, the execution stops in the movement method:

So, the error is related to the PlayerStart. By the way, there is a character set as default spawn in the game mode, but I don’t spawn any character.

Any idea?

Thanks.

I would investigate this. If you place a player start, the player spawned by the game mode should begin there.

I really don’t know how you’re making this happen :slight_smile:

I think there is a Character spawned:

There is a BP_GalaxyPlayerCharacter().

@ClockworkOcean I’ve found the error. The character doesn’t because it is surrounded by a lot of actors.

I have changed the PlayerStart’s location and now the character moves.

I apologise for all the time you may have wasted on with this silly mistake.

1 Like

Good you found it :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.