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

[JASS] function to disable camera movement from arrow key events

Status
Not open for further replies.
Level 8
Joined
Nov 9, 2008
Messages
502
IS there such a function to disable the arrow keys affecting the camera or do I need to manualy lock the camera?
 
Level 8
Joined
Nov 9, 2008
Messages
502
Ok I thought as much. Instead of applying it every X wouldn't it be more efficient to check first if current camera is different to desired camera?
 
Level 6
Joined
May 7, 2009
Messages
228
Don't snap the camera (apply it over .02 seconds or something), and there's no way to check if the camera has changed before applying it.

You can if you store the correct camera values beforehand and do a comparison. However, there's no real reason to do so because it takes just as much time to get the camera status as to set it, so you are just making things worse by checking first.
 
Level 6
Joined
May 7, 2009
Messages
228
You can find the target x,y, the target distance, and the angles, which allows you to find the camera x and y if you really need to
 
Level 8
Joined
Nov 9, 2008
Messages
502
Don't snap the camera (apply it over .02 seconds or something)

Ok thats helpful thanks.

You can if you store the correct camera values beforehand and do a comparison. However, there's no real reason to do so because it takes just as much time to get the camera status as to set it, so you are just making things worse by checking first.

Hmm that's logical. Will do.

Thanks ppl I can now get rid of this 'Lock Camera to unit' function. Cheers!
 
Status
Not open for further replies.
Top