• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[General] Lock Camera and rotate around unit while he moves

Status
Not open for further replies.

JnM

JnM

Level 12
Joined
Oct 2, 2005
Messages
81
Hi all,

Been dipping my feet back into WE and enjoying it. My question: Is there a way to lock a camera and make it rotate around a unit while he's moving towards a region?

So far I've only been able to find "Rotate around (position of (triggering unit))", but obviously it doesn't follow the unit.

Do I need to create a periodic event trigger with camera/unit variables or am I missing something?

EDIT: Apologies, I've moved this thread to Trigger/scripts
 
Last edited by a moderator:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,587
Lock the camera to the unit and then adjust the Rotation field, like so:
  • Camera - Lock camera target for Player 1 (Red) to Unit, offset by (0.00, 0.00) using Default rotation
  • Rotate Camera
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet r = (r + 1.00)
      • Camera - Set Player 1 (Red)'s camera Rotation to r over 0.00 seconds
Note that an actual Timer would be better than a Periodic Event as it can run more times per second, creating a smoother rotation.
  • Countdown Timer - Start t as a Repeating timer that will expire in 0.01 seconds
  • Rotate Camera Timer
    • Events
      • Time - t expires
    • Conditions
    • Actions
      • Set VariableSet r = (r + 1.00)
      • Camera - Set Player 1 (Red)'s camera Rotation to r over 0.00 seconds
 

JnM

JnM

Level 12
Joined
Oct 2, 2005
Messages
81
Thank you both for your responses.

I believe I found the solution to my problem: I needed to create a camera variable that saved the lock camera position. I can apply that camera variable starting from another locked camera. I don't need to create a periodical event, but I do need to keep tabs on camera variables. It's a pretty neat effect.

If all goes well, I'll post what's cooking. It's basically a remake of DaemonKillars cinematic camera showcase, which I'm pretty certain is long gone now.
 
Status
Not open for further replies.
Top