Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How To Change Level To Specific Spawn Point

I've been having some trouble. I know the basic way of changing the level but what if I want there to be more then one entrance like a cave or a huge open world and want the player to spawn outside of the house or cave's entrance? I tried the teleport command in the Blueprint but it just keeps taking me to location '0.0.0' anyways. Is there a way to make it to where the player will spawn at a certain actor or just a certain location on that level?

Product Version: UE 4.11
more ▼

asked May 24 '16 at 10:22 AM in Using UE4

avatar image

3 2 3 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

I know this post is a bit old, but I wanted to expand on that answer. You can use a Game Instance to achieve this. Basically when the player collides with the trigger volume, door, static mesh, etc (whatever you have triggering the level change), it should first set a variable. So if you want your player to move to Level: Dark Forest at Entry Point: 2, assuming you've got multiple possible entry points, then set EntryPoint=2. It's probably best to create an enum for this. Then pass that value to the Game Instance. When you load the Dark Forest, do a switch on the enum to check the value and move the player to the corresponding point.

To Recap: - Create a Game Instance - this persists as long as the game is running. - Create an Enum containing possible spawn points for a level (or all levels), or create multiple Enums - one for each level. - In your player, when they collide with the level changing trigger, have them set the Enum value and pass it to the Game Instance. - When the new level loads, load the Enum value from the game instance, run a switch on it, and move the player to the corresponding spawn point. It would be good to check if it's valid first so you don't spawn the player underground or in a wall. - That's it!

Wanted to leave this here in case anyone else comes looking for an answer and wanted more information. Sorry to necro an old post.

more ▼

answered Apr 19 '18 at 03:13 PM

avatar image

36 1 4 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The simplest way to handle this is to spawn the player somewhere offscreen, in the dark, or while a UI is covering the screen (Loading..). Then pick where you want them and move the player there with either teleport or set location.

Be certain the location you are moving to is valid though. If you try to move somewhere and it encroaches the player it can destroy the actor and your camera will just go to 0, 0, 0. Try setting the locations you are teleporting to either higher up (some games you may notice you spawn and fall a little) or by finding the spawn position, adding some Z to it and tracing down to the ground with a sphere trace the radius of the pawn. This will hopefully guarantee a starting location.

more ▼

answered May 24 '16 at 06:05 PM

avatar image

2.6k 98 16 97

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question