• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Camera Help!

Status
Not open for further replies.
Level 2
Joined
Aug 4, 2009
Messages
8
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:
 

AK-

AK-

Level 1
Joined
Aug 25, 2009
Messages
3
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
 
Level 4
Joined
Jul 15, 2009
Messages
29
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.
Top