• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

how to lock camera to specific location

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,658
-_-
That is what I said.
But didnt knew for sure if you would use JASS or GUI so I just said the 1x1 or 0x0 region.
That one however, sets the bounds to the center of the map.

This one sets the boundary to x,y or to the cameras current (use inside GetLocalPlayer())
JASS:
function LockCameraOnCoordinate takes real x, real y returns nothing
    call SetCameraBounds(x, y, x, y, x, y, x, y)
endfunction

function LockCamera takes nothing returns nothing
    call LockCameraOnCoordinate(GetCameraTargetPositionX(), GetCameraTargetPositionY())
endfunction
 
Level 23
Joined
Feb 6, 2014
Messages
2,466
How about locking the angle of attack?
I used this with a periodic timer but I'm not sure if it's the best way
JASS:
private function PeriodicCameraPosition takes nothing returns nothing
    call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, 270, 0)
    call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, 3000, 0)
endfunction

with a call TimerStart(periodic, 0.03125, true, function PeriodicCameraPosition)
 
Status
Not open for further replies.
Top