• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Camera Moves Down Cliff With Hero

Status
Not open for further replies.
Level 8
Joined
Sep 23, 2007
Messages
358
I am using a third person camera in my map. The camera moves up, at least a little bit, when moving uphill, but when I move downhill the camera stays where it is. I tried searching for camera tutorials but couldn't find any that work in this way.
 
Regions for every cliff? Have fun ;-)
You can easily get the terrain height and the cliff height with triggers.
  • Set P = (Position of unit)
  • Custom script: set udg_Terrain_Height = GetLocationZ(udg_P)
  • Set Cliff_Height = (Terrain cliff level at P)
  • Custom script: call RemoveLocation(udg_P)
Now do the same thing with some points around the unit, or maybe better: save the previous cliff/terrain height in a hashtable with the unit's key.
Then you know whether it is moving upwards/downwards and can adjust the camera accordingly.

PS: Using the terrain height should be sufficient for this, as higher cliffs also have a higher terrain Z.
 
Regions for every cliff? Have fun ;-)
You can easily get the terrain height and the cliff height with triggers.
  • Set P = (Position of unit)
  • Custom script: set udg_Terrain_Height = GetLocationZ(udg_P)
  • Set Cliff_Height = (Terrain cliff level at P)
  • Custom script: call RemoveLocation(udg_P)
Now do the same thing with some points around the unit, or maybe better: save the previous cliff/terrain height in a hashtable with the unit's key.
Then you know whether it is moving upwards/downwards and can adjust the camera accordingly.

PS: Using the terrain height should be sufficient for this, as higher cliffs also have a higher terrain Z.

Thanks, this was helpful :)
 
Status
Not open for further replies.
Back
Top