‫Welcome back.
‫In this video, we're going to talk about possession now.
‫We're not talking about demons infesting your body.
‫We're talking about controlling pawns in the world.
‫So let's talk about how we can designate a pawn to be possessed.
‫So we're back here in the ED and we have several pawns in the world now by default, none of these are
‫designated to be possessed by a controller.
‫That means we cannot control them.
‫If we press play, we'll see that we have the ability to move around with the WASD keys.
‫That's because we are controlling the default pawn.
‫This is something built into the engine and it will be there for us if we do not designate one of our
‫pawns to be possessed.
‫Now, the way to designate a pawn to be possessed is to select the pawn instance in the world.
‫And in the details.
‫Panel search for a variable called auto possess player.
‫Now Auto Possess Player by default is set to disabled, but if you click the dropdown, you'll see player
‫zero through seven.
‫Now these are not talking about multiple players in a networked multiplayer game.
‫These would be multiple players on a single instance of the game, such as in a split screen game where
‫two people are playing on the same console or computer.
‫So for our game, this will always be player zero.
‫Now what you do is you set this to Player zero for the pawn you would like to possess, and then when
‫the game starts, that pawn will be the one possessed by player zero.
‫And again in our game there is only one player and that is player zero.
‫So as a challenge, I'd like you to experiment with this possession thing.
‫Set auto, possess player to player zero on one of the turrets.
‫See what happens.
‫Press play and observe the results of setting this variable.
‫Then try setting it on the tank.
‫Now you're going to need auto possess player set to player zero only on one of the pawns at a time.
‫Otherwise the engine doesn't know which one you mean to possess, so it's just going to pick one for
‫you.
‫So make sure auto possessed player is disabled on all pawns except for one at a time.
‫Pause the video and experiment with possession now.
‫Okay.
‫So the first thing I'm going to try is I'm going to select one of the pond turret instances and set
‫its auto possess player to player zero.
‫Now if I hit play, I'll see that I'm stuck to this turret.
‫And of course I can't move around or anything because we haven't programmed any movement and we're not
‫even going to for the turret anyway.
‫So this is not very exciting.
‫It's actually kind of frustrating because we're stuck to this turret and we can't move around.
‫We just see the tank sitting there.
‫So I'm going to hit stop and with that same pond selected, I'm going to change this auto possess player
‫back to disabled.
‫Now the next thing I'm going to do is select our tank.
‫Now, you may have noticed as soon as you selected the tank in the world, we have a little pop up window
‫showing us the view from that tank camera.
‫Now, this is a nice built in feature because it's showing us the view that we would have from this
‫camera if we were possessing the pond.
‫And we can see that if we set auto possessed player to player zero for the tank.
‫Now let's go ahead and hit play and check it out.
‫We see the view from the point of view of that camera.
‫So that's pretty awesome.
‫Now again, we can click in the viewport and try to move around, but we have not handled any input.
‫We're not changing its location with anything in the code.
‫That's something that we have to implement ourselves.
‫But the possession part actually controlling the pawn that we are now accomplishing.
‫So in summary, we learn how we can possess a pawn and that by setting its auto possessed player variable
‫to player zero is the way to do this.
‫So now that we're possessing the pawn, it's time to control and move the pawn and that we will cover
‫in the lectures to come.
‫Exciting stuff.
‫I'll see you soon.