Hi all. Just trying to do something simple but I can’t figure it out.
I can teleport my player to another level using the “Open Level” node. But that teleports the player to a “player start” actor.
I can also teleport the player to any given location in the current level.
But I can’t for the life of me figure out how to do both. To teleport the player to a specific location within a different level.
Any ideas???
It doesn’t need to be anything complex. It will always be the same location so it can be set directly in a transform. Something like this http://i.imgur.com/0LgOGnH.png
Cheers all. Any pointers are very much appreciated.
Opening another level will cause it to go to the player start/Player 0, because it won’t bring info from the previous level (Ex: if you have 25% of Health, it will be full on the next level).
I think you are trying to do something similar to Borderlands fast travel, (EX: From Fast Travel 2 from Fyrestone, to Fast Travel 4 in Gully Skag) but instead of 2-3 teleporters in fixed places, the player can teleport anywhere he wishes on the level.
Well, in that case, I think it there would have a connection between those levels, where the info you stated in the first level goes to the second, but since i’m kinda new too, I can’t help too much, but:
I think it would be necessary to create a variable to store where the player desires to teleport, and then at the next level BP, use an Event Tick/Begin Play > Teleport with the connected variables into the node, that requires you to cast or reference the BP where the variable is in order to get it properly.
You could make a large collider BP and use the method above with it, instead of the level BP.
I don’t have trouble getting info persisting between levels. But actually being able to use the value of a stored vector in a level switch is what I can’t do.
Tried it the way you mentioned already and that doesn’t work. It just moves you to that location in the current map, then opens the referenced map at the default start location
Strange, I’ve used the ThirdPerson Player from the Loading tutorial from Epic.
The Stream_Character BP is the name of the Player BP, did you try to do that? the New_Var_0 stores the Dest Localtion that i’ve typed in Details, and in the Level BP it will executo the Teleport function with the variable connected.
Bear in mind that is a very rough concept of how it would work.
Now on Level1 use the OpenLevel node to go to Level2.
You should now load Level2 and immediate be transported to the Spawnpoint mesh.
“PlayerCharacter” is the name of my Character Blueprint (yours might be ThirdPersonCharacter). The offset inside the red square is so your character doesnt get stuck inside the SpawnPoint mesh (play around with the Z value).
@CoquiGames, you don’t even need to consider a spawn point, if you set your player pawn in Details tab to be the player 0, then it will becomes your PlayerStart when you place it in the level.
But your solution is good too as you avoid to create a variable, if you have a fixed position, then just using the Vector+Vector or just split the structure in New Location might be useful, if it was something that could be in any position, then a variable would be better to store the position from the map and send it to the New Location.
The suggestion by Pavomba doesnt work. It would make the player always start at that location every time he enters that level.
I want the player to start at a “Player Start” actor the first time he enters that map. And when he enters that map via activating a portal, he doesnt get teleported to that player start, but an entirely separate location within the map.
And again, the second method you mentioned, just teleports you to that location in the current map, then teleports you to the next map at the player start.
Strange, I’ll try to upload the files later, but did you delete your player start in favor of the pawn being the player 0 in details? if not, it might be the reason, the Player start might be hampering that.
I’ve successfully done it the way CoquiGames suggested. And you shouldn’t need the cast or offset (as long as the spawn point do not have a mesh).
To make it even nicer, put the logic on the spawn point actor instead of in the level blueprint. You can then extend it to handle multiple spawn points and have only one trigger depending on game persistent info. I have made a system just like that and it worked great!
I ended up using tags on the two player starts. Stored a value equal to the tags which was modified by using one of the portals.
I then override the choose player start in the game mode to select the spawn points based on their tag.
I use The OptionsString to teleport to a specific Location.
I have a custom Trigger with a number. This Number is put into the Options String (in the Open Level node).
in My GameMode, the PlayerStart is searched according to this number and used as Spawn point then.
I have the same issue, can you please elaborate a little bit more about your configurations? I created an archviz project with a lobby level and an apartment level connected by a trigger and widget menu inside the elevator and I want to change the player initial start to the elevator point when the player come back to the lobby from the apartment.