• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Getting the right camera height for my cam/movement system

Status
Not open for further replies.
Level 8
Joined
Mar 3, 2009
Messages
327
the movement system is third person (like first person but the camera is back so that you can see the unit that's moving). I can't get the height offset right though.

could someone post the code for accurately detecting how high the camera should be over elevation? thanks.
 
Try >
  • Set Point1 = (Position of (Picked unit))
  • Custom script: set udg_Height = GetLocationZ(udg_Point1) + GetUnitFlyHeight(GetEnumUnit())
  • Camera - Set (Owner of (Picked unit)) Height Offset to (200 + Height) over 0.00 seconds
  • Custom script: call RemoveLocation (udg_Point1)
Height is a real variable.
Point1 is a point variable.
the action for Camera is Camera - Set Camera Field (timed)
 
Level 8
Joined
Mar 3, 2009
Messages
327
thanks, but getlocationZ doesnt cut it. The camera goes higher than the unit, and as far as i know there is no correct formula to multiply it buy to produce the right height (eg, set height = GetLocationZ(udg_temppoint) * 0.8).

I know another function that can be used is GetCameraEyePositionZ, i've seen it used, but im not sure how to use it.
 
Status
Not open for further replies.
Top