How to focus player camera on Vector or Actor [UE5 Tutorial]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
yo what is going on guys my name is DeadEagle and  today I'm going to show you guys how to rotate the   control rotation to focus on a certain object or  vector, so in other words we're going to make the   player camera focus on this box. you can also  do this with an enemy for example with another   blueprint but in this case we're just gonna focus  on the vector of this box so what we want to do is   I'm going to create a trigger and if you walk over  that it will happen basically so we're going to   create a Blueprint Actor and we're going to call  it ROT_Actor, and then we will drag it right here,   we will add box collision and we will resize this  in the level so then we want to scroll down and on   component begin overlap then the other actor  in this case is going to be the third person   character then we want to do a do once we want  to add this just to be sure that we don't walk   over it a second time and it keeps going longer  than five seconds you can do whatever you want   but I'm just going to add that in this case and  the next thing you want to do is add a timeline   it's called "Timeline" doesn't really matter  and in this case we will just do five seconds,   let's add a float track & let's add a key set the  time to zero add another key and set the time to   the end which is five in this case and the value  doesn't really matter because we're not going to   use that all right so we want to get the actor  location from the player character and we want   to get control rotation from the player character  as well and then from the actor location we want   to find look at rotation then in this case  we're going to use the vector from that box   but you can also use the vector from another  character so if you want to do that you can   just cast to that character here and use that  vector just plug it in there but in this case   we're going to split the construct pin the struct  pin I'm sorry and we're going to copy the vector real quick paste it in here so that will be  the location we focus on the vector of this box   so then the next thing we want to do is we  want to re-enter two and then the current is   actually the control rotation that is  actually the current control rotation   right and the target is going to  be the look at rotation like that   so the next thing we want to do is we're going  to get their controller right and from the player   control we want to set control rotation oh yeah  I'm sorry set control rotation and new rotation   is the rotation that's coming out of the * too  then we want to update from the timeline so every   time the timeline will update it will call this  set control rotation and then the only two things   we have left to do is we have to get the Delta  time so that is get World Delta seconds right here   and the enter of speed we can just set that  to let's just set it to two in this case   and if we go into the map right now and we get  this get this trigger place it like this so if I   walk into it as you can see the camera will focus  on the cube on the vector so if I do that again   if I keep walking as you can see the camera also  just decides where the player is going to going   to walk / face if you know what I'm trying to say  so as you can see if it's rotating the player will   rotate around the cube as well which is perfect  for if you want to use something like this in your   game if you want to focus on a certain boss or a  certain door that's opening or you know whatever   you want to want to do you can use that so you  can in this case it's a trigger you can obviously   call this event on you can do whatever but in  this case I just use a trigger but obviously   you can do whatever so I hope you guys enjoyed  this simple video and I'll see you guys later
Info
Channel: DeadEagle [Spitfire-Games]
Views: 15,498
Rating: undefined out of 5
Keywords: unreal, engine, unreal engine, ue, ue5, cloth simulation unreal engine, ue5 tutorial, unreal engine tutorial, epic games, blender, blender tutorial, focus player camera, how to make player camera follow actor, ue camera tutorial
Id: rraI4TrBwSs
Channel Id: undefined
Length: 5min 26sec (326 seconds)
Published: Tue Jan 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.