How to teleport the player character to another actor's position?

Hello, I just cannot figure out how to do a simple teleport. I have a first person character blueprint that I made from scratch and set as the default pawn class of the game mode. When I hit Play, everything works, movement and all, but I start from wherever the camera was on the editor viewport. What I want is to start at where another actor is (let’s call it PlayerStart), so I thought of simply teleporting the character to PlayerStart at Event Begin Play. But I cannot figure out how to do it.

I thought this would do the trick but all I get is a bunch of errors when I hit play and I get teleported to a random place.

So how should I do this? Thanks in advance.

The picture in the link looks just right, the question is: where are you doing that? In which BP?

Anyways, all you need to teleport is:

  1. a reference to your character

  2. a reference to the “PlayerStart” actor

You can do that anywhere you want (changing the code accordingly); let’s say you want to do that in the Level BP, so:

  1. select your character and create a reference for it in the Level BP graph (right mouse button → create a reference)

  2. select the “PlayerStart” actor and do the same

  3. get the world position of the PlayerStart

  4. pass it to the Set Actor Location node (just like shown in your picture)

  5. make sure the Target of the Set Actor Location node is your character’s reference you grabbed earlier

Hi and thanks for the answer. I did that in the picture in the character BP. I did what you suggested but, doing it that way doesn’t seem to work with this first person character, because I use it as the default pawn class, so even if I put the character blueprint in the level and hit Play, it still spawns me where the camera is. So teleporting the character in the level does nothing to the character I’m posessing. However if I do it in the character BP instead of the level BP, the character I’m controlling does get teleported, but I don’t know how to reference the PlayerStart actor in the character BP so I can use it as the destination of the teleport. Is this even possible to do?

Sure, there are a couple of ways you can do that; for example, you can create an Actor variable in your Character’s BP and make it public. Then if you have the Character BP already in the scene, select it and assign the PlayerStart to the variable you created earlier. In the graph, now you can get a reference to the PlayerStart through that variable. Hope it helps.

I’m sorry, but how do I assing the PlayerStart to the variable? I can’t find out how.
Edit: I assigned it to the actor variable in the ‘Default’ tab on the details of the Character BP, is that what it was? Because I then did the same SetActorLocation thingy and it’s still giving me the “Accessed None ‘Actor’”

The variable should be public (click on the eye icon next to the variable’s name); once it’s public, in the Editor (not the BP editor) select the BP which holds this variable in the scene outliner, and assign the PlayerStart to it.

I created a fresh new FPS BP template project. Here’s what I did in the FirstPersonCharacter blueprint (which is already in the scene once you create the project): Imgur: The magic of the Internet

Try to do the same steps with a new project. If it does not work, then we have a problem :slight_smile:

Well, let’s try to understand what’s going on. Are you doing something special with your custom character? In what is it different from the standard one?

Okay, there must be something wrong here. Here’s how the character BP looks like: http:///nJh6Bpb.png And here’s how PlayerStart is assigned to it (assuming this is the right way to assign it because that’s what the documentation seems to say): http:///u249BNW.png And it keeps giving me this error: http:///MKYrcmV.png

So I don’t get what I’m doing wrong anymore? Though honestly even if we manage to fix it so I don’t get the error anymore I don’t feel like I’m going to be teleported because, like I said, it’s not the character BP that’s in the level that is the one I take control of when i hit Play, but the one that I assigned in the “Default Pawn Class” in the Game mode blueprint. But I could be wrong and get teleported regardless, so why am I getting that error message?

Oh well, it does work if I use the FPS BP template character. It doesn’t work if I try it in a character I made from scratch. Weird.

Nothing, I just made the inputs myself for walking and looking around in an empty Character BP.

Is your character used by the current Game Mode?

Yeah I guess, as the default pawn.

Can you post a screenshot of your character BP’s event graph and World Settings please?

Sorry for the late response today

BP so far: http:///rer25QP.png
And World Settings, are they these settings? http:///OhP0rRN.png or maybe these http:///PcG6QAG.png

Looks like you’re not setting a Game Mode in the World Settings. Can you double check your Map & Modes in the Project Settings?

I was indeed not setting one, but I did and even still it would give me that error.