How to Teleport the Player to another Location in the Level through a Door in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new unbrew engine 5 tutorial today I'm showing how to teleport the player when it goes through the door into another part of the map it's gonna be a very easy build to follow so let's get started alright so the first thing they're going to do is right click create a new blueprint class and let's create the actor this is going to be the door that we are going to go through so of course you can change to be anything else it doesn't need to be a door but in this sample gonna be using the door so let's say BP at teleport door it doesn't really matter in the name so let's open this up and the cool thing is that because I have the starter content uh enabled I installed I do have some tour message so if you don't have against your contact pack content and 4D started content so what we're going to do here is just add a static mesh this will be door um how is it called the outer part of the door let's see door frame there we go door frame door frame and then we're gonna duplicate this and it's gonna be the door itself and of course we're going to change this to be the door itself and I'm going to move it so it snapped inside and of course maybe we have to change this to be five so we can move exactly inside there we go so now it is perfect so now we have door let's just go ahead and open the door itself a bit open we can just do like this maybe you decide it from the inside on the outside you decide but basically what we are going to do in here is add a box and it's going to be coalition it's gonna be our trigger so when the player enters in this box we'll basically do the top rotation and everything that we have to do so we're going to do is adjust bit the size of this we can also put it higher so it matches a bit better the placement and we can just expand with this you can put it so it's you know you have to wait so much for the play to enter and so on you can you know experiment and so we're going to do is go down and make sure that the Collision preset is set to overlap all Dynamic and then we're gonna go into the events and in the on component begin overlap we are going to click on you know add event so when something enters this trigger we are going to do something in this case let's check that our player is you know the the the actor entering into the player so we're gonna cast to the third person character blueprint or whatever character weapon you're using and if it's so you know it will be it will mean that it is the uh player so what we're going to do in here is just to test it when I say print so now I can just drag in my door here as you can see um and of course maybe yeah maybe it should be through the other let's do it like this I prefer to like this till I recite yeah that's a bit nicer um so now you need to go here you can see when I pass it prints hello and the screen as you can see here in the top left corner so now we can start doing things so what we are going to do with this door is basically just indicate where we want to to report so let's create a variable this will be B and TP pause and this is going to be a vector because it's going to be placed in the scene so what we can do is to make it easy for us to specify where we want to teleport what we can do is uh basically make it instance edible so it will be public with this eye so we can access it from outside of blueprint and then also when I make it that it will show a 3D widget and you know basically understand this better when we actually showcase this um but actually I can just show you right now and now if I select the blueprints you can see now we have a gizmo I could select this Gizmo now you can see it's white and I can move it so now I could teleport my player to be let's say on here so teleport to be here right so you will see that it will just go and we have a gizmo which we can move and it will just be more convenient so now what we can do is get our player and then use uh set transform well we can I I prefer to not set up the whole transform you set the location and rotation and but that's just preference but honestly we are not touching the rotation right now uh we could do so in a second but we are just gonna actually yeah just by rotation and location so in this case our TV bus will be this one but of course this is a vector so I will not come um contain the rotation so what I am going to do is convert this Vector into whole transform and I will just change the variable type and we just update a second we go of course this doesn't work like that so now we can need to drag it get it right click split it and now we'll just plug in the location and rotation and probably it did yeah is it put it back in here so let's select it go back here so now basically whatever it is looking uh you know it will go through so you can rotate it so we'll start where you want and so on okay so I'm not gonna rotate it right now but you can see that that will work and you will see that with that it should do the job if I now go through the door it will go ahead and enter the port now it is being broken and why the thing is that this position is in local space because it's basically inside this blueprint so it's a relative location and our player is in a world rotation and location because it's outside this blueprint so we have to convert this uh location and rotation to be in the world space so let's go ahead and do so so to do this we have to use a node so what we're going to do is get the location and call this transform location and this will convert the location from a relative position to a weld position and here we're just gonna pass the get actor transform and we can just plug it into the new location so here's a conversion basically I can just put this in order since a bit nature and for the rotation we don't need to do so um so now we can use press play you can see I go to door and now yes we are in that exact position and it will work and if I were to move my Gizmo into another place for example the other box here it would work still as you can see perfectly and last thing I'm going to mention is that if you type the or type no check the teleport uh check box here basically physics will not be effective so for example you have hair or you know Ragdoll and when you basically teleport without this shade on it will basically like move all the bones quickly all the hair all the physics and will look a bit wonky so you want to make it more I guess realistic we could say you just need to check that so like keep the physics how they are okay but in my case I'm just gonna decide through the because yes so that's it guys if you found this so helpful a real shake like video And subscribe to my channel a lot of Unreal Engine part 2 so check them out during my Discord server and check out the profiles on my patreon and YouTube members and now yes with all that said bye bye all right
Info
Channel: Gorka Games
Views: 10,366
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5, teleport player, tutorial, quixel, megascans, unreal engine player teleport, player tp unreal engine 5, ue5 teleport character, ue5 tp player through door tutorial, ue5 how to teleport to another position
Id: GFw4XPJyq8A
Channel Id: undefined
Length: 7min 34sec (454 seconds)
Published: Fri Jun 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.