Camera Help!

Status
Not open for further replies.

Shamwow

S

Shamwow

Im trying to make a 3rd person camera that is fixed behind the controlled character but im completely lost with the whole camera thing, so if anyone can show me a trigger for it or point me in the right direction to find out how id really appreciate it :grin:
 
Need camera ???

The easiest way to make a 3rd person camera is as the following


Create a new camera and new unit (for camera to follow) and position the camera in a desirable place behind your new unit.


now enter the trigger editor and make a new trigger that looks like the following


//========================================================

Events
Time - every 0.01 seconds of game time
Conditions
(none)
Actions
Camera - apply ( THE CAMERA YOU CREATED ) <gen> for ( PLAYER OF CHOICE ) over 0.00 seconds
Camera - Lock camera target for ( PLAYER OF CHOICE ) to (UNIT OF CHOICE) <gen>, offset by (0.00, 0.00) using the units rotation
Camera - Set (PLAYER OF CHOICE) camera Rotation to (facing of UNIT OF CHOICE <gen> ) over 0.00 seconds

//========================================================

This is a relatively simple 3RD person camera, though you can add delays and things on to the script with ease
 
Okay. 0.01 game time is effective, but not necessary. Create two triggers, one called "Initialization" and one called "Player's Camera".

Initialization:

  • Events - Map Initialization
  • Conditions -
  • Actions - start (Your Timer) as a repeating timer that will expire in 0.10 seconds
Now for Player's Camera:

  • Events - (Your Timer) expires
  • Conditions - if(YourUnit) is alive = true
  • Actions - Pick Every Player in All Players and do actions:
    • Lock Picked Player's Camera to (Their unit)
    • Set Picked Player's Distance to Target to 700
    • Set Picked Player's Angle of Attack to 340 over 0.5 seconds
    • Set Picked Player's Camera Rotation to (Facing of (Your Unit)) over 0.25 seconds
The problem with this is that the camera won't up and down with your unit. So create a "real" variable, not array, named Z_Unit and a "point" variable, not array, named Position_Unit

Now change your Player's Camera trigger to this:
  • Events - (Your Timer) expires
  • Conditions - if(YourUnit) is alive = true
  • Actions - Pick Every Player in All Players and do actions:
    • Set Position_Unit = (Position of (Your Unit))
    • Custom script: set udg_Z_Unit=GetLocationZ(udg_Position_Unit)
    • Lock Picked Player's Camera to (Their unit)
    • Set Picked Player's Distance to Target to 700
    • Set Picked Player's Angle of Attack to 340 over 0.5 seconds
    • Set Picked Player's Camera Rotation to (Facing of (Your Unit)) over 0.25 seconds
    • Set Picked Player's Height offset to 100 + Z_Unit over 0.25 seconds.
    • Custom script: call RemoveLocation (udg_Position_Unit)
Now you have a fully operational 3rd person camera. To make it a first person, just set the Distance to target to zero and set the field of view to 30.

----------------------------
Give reps where we earn them!
 
Status
Not open for further replies.
Back
Top