• 🏆 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!

[Trigger] Problem with camera and terrain height

Status
Not open for further replies.
Level 10
Joined
Aug 15, 2008
Messages
448
Hello everyone.
I have made a 3rd person system with camera, controls and stuff, working with every player slot. The only problem I have is that, when nearby a raised terrain, the camera will go up or down, depending on how much is the terrain height difference).
So, what I'm asking is: is there a way to prevent the camera from adjusting its height when nearby a raised terrain? Maybe a trigger that gets the TerrainHeight and then subtracts it from the camera height?

Thanks.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,199
Maybe a trigger that gets the TerrainHeight and then subtracts it from the camera height?

Why are you even asking? Why do you not just do it? Considering there are natives to get terrain height already, just use those on your camera height and factor in unit height.

To be more helpful, use this native.
JASS:
native GetLocationZ takes location whichLocation returns real
 
Level 10
Joined
Aug 15, 2008
Messages
448
The real problem is that, except very few lines for removing leaks, I don't know how to use Jass... =\
I'll try putting this in the map but, meanwhile, could you post the entire trigger? I guess it's something that will store the height in a real variable, so I could run the trigger, get the height and then use the variable in the main trigger, right?
Thanks. =)

EDIT: I've made the trigger with the native you gave me but the situation was still the same... but I think it's just me not knowing jass. xD
Anyway, is there any kind of trigger capable of simply disabling the camera height adjustment?
 
Status
Not open for further replies.
Top