UnrealScript Game Programming Cookbook
Scripting a Camera System 68 Creating a first person camera While a first person camera comes standard with UDK, we've crafted a ...
Chapter 3 69 Follow that up by declaring the two new variables that we'll need, CamOffset, which is of type Vector, and CamOffs ...
Scripting a Camera System 70 This part is slightly different from what we've seen before. Rather than offer the option of choos ...
Chapter 3 71 I've included a reference as well, to give you a better understanding of how the Unreal Engine converts degree rota ...
Scripting a Camera System 72 Creating a third person camera UDK now comes with a third person camera built into the kit, but we' ...
Chapter 3 73 Remember when we hid our pawn from view before? Well this time we're going to allow the pawn to be shown, but hide ...
Scripting a Camera System 74 Where the magic happens is in the default properties. We're shifting the camera so that it gives u ...
Chapter 3 75 Creating a side-scrolling camera Side-scrolling games have been a hit for decades, and some of gaming's largest fra ...
Scripting a Camera System 76 super.PostBeginPlay(); 'Log("TutorialPlayerControllerSSC up"); } /********************************* ...
Chapter 3 77 This next bit seems long-winded, but it is essentially one function (really, a state) that we are overriding from ...
Scripting a Camera System 78 if( Pawn == None ) { GotoState('Dead'); } else { GetAxes(Pawn.Rotation,X,Y,Z); /** The only change ...
Chapter 3 79 ReplicateMove(DeltaTime, NewAccel, DoubleClickMove, OldRotation - Rotation); } else { ProcessMove(DeltaTime, NewAcc ...
Scripting a Camera System 80 Furthermore, it allows the camera to clip beneath the ground and turn it invisible. If we continue ...
Chapter 3 81 How it works... There was no need to reference our CameraProperties archetype in this example, as we've hardcoded o ...
Scripting a Camera System 82 Getting ready We're going to make a whole new PlayerController class for this tutorial, as we need ...
Chapter 3 83 // Allows the pawn to rotate left and right DeltaRot.Yaw = PlayerInput.aTurn; ProcessViewRotation( DeltaTime, ViewR ...
Scripting a Camera System 84 Now add our functions as shown in the following code snippet: /***** Query ViewTarget and outputs ...
Chapter 3 85 /*socket not found, use the other way of updating vectors / if(Pawn.Mesh.GetSocketWorldLocationAndRotation ('Weapon ...
Scripting a Camera System 86 I used a pitch of -80 degrees to have the camera point down at the pawn. You'll notice that my pitc ...
Chapter 3 87 The final change we need to make is in the TuorialGame class. Be sure to change the following code in your default ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf