HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Camera Issues

09-11-2002, 05:58 PM#1
Guest
I'm working on a map with that "behind-the-head" viewpoint. How do I make the camera face the same direction as the unit that it is locked to? The camera seems to always face the same direction (say, North), no matter which direction the unit is facing. How can I make it stay behind his head?
09-11-2002, 07:22 PM#2
h0pesfall
make a Real variable called Angle
make a periodic event that sets Angle to the facing angle of <unit>
make a periodic event that sets camera angle to Angle

voila
09-11-2002, 11:27 PM#3
Guest
I am having the exact same problem. I listed my trigger setup in a thread titled "storing a units angle into a variable". If you would figure out the exact triggers that work I would be EXTREMELY grateful if you shared it. It is kicking my arse for a week now.
09-12-2002, 03:58 AM#4
h0pesfall
mullet i use a trigger almost exactly like yours, but i use a specific unit selected from the map instead of a unit group, and mine works. maybe a unit group can't return an angle? that'd be logical since unit groups are mostly used for multiple units, could explain why blizzard didnt make it return an angle or something.
09-12-2002, 05:17 AM#5
Guest
I figured it out. It was a name of a custom unit. Name and Proper name have to be the same for that apparently. I explained in another post
09-17-2002, 10:32 PM#6
ngevangelion4
ok i have the camera locked on the unit now how do i set the angle of attack to be near ground level.
09-17-2002, 11:45 PM#7
Guest
Event: map intialization

Action:
Camera - apply [camera name <gen>] for player 1 (red) over 0.00 seconds.
Camera - Lock camera target for player 1 (red) to ([unit]), offset by (0.00, 0.00) using the unit's rotation.
---
Now my camera I created during map building will apply and lock itself to my unit I created.
---
Event: Every 0.10 Seconds of game time

Actions:
Unit group - Pick every unit in (units owned by player 1 (red) of type steam tank ) and do (set [variable] = Facing of (picked unit)))
Camera - Set player 1 (red)'s camera rotation to Facing over 0.10 seconds

---
And now it follows the unit's facing....
I had to do it this way since the units both respawn and are created after map initialization. All of the angle of attacks and such are done during map creation when I make the camera, although I am sure you can make it do whatever doing triggers.

I hope this helps.