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.
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
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?