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

[Solved] Returning camera heightZ of certain player

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
You cant.
You can only load the settings of one's camera on a local client.

So, when running this function, it might return a different value for you as it does for me.
You can however, keep track of what values it has been set to... but that is something else and not always useful.
 
It depends on what you want to do with it. If you simply want to do something visual, chances are you can just put it in a local block and run the action locally, e.g.
JASS:
if GetLocalPlayer() == Player(0) then
    // do stuff with GetCameraTargetPositionZ()
endif

If you really need to perform something globally, then you may want to synchronize the player's camera data between players, like so:
ObserverMode and PlayerCameraData

Again, it depends on what you need to do. If you choose the synchronization option, then you'll have to tolerate delays (expect ~250-500 ms delays on battle.net). If you choose the local option, you can get it instantly, but you can only do local-safe stuff. For more info on GetLocalPlayer(), check this thread out:
JASS: GetLocalPlayer() | The Helper
 
Status
Not open for further replies.
Top