HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

locking camera

03-16-2006, 01:34 AM#1
Linera
I want to lock the cam so the unit is always in the center of the screen.

Here is my current code:
I want to know how to code it so unit is centered on screen.

Trigger:
CamLock
Collapse Events
Time - Every 0.20 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 2, do (Actions)
Collapse Loop - Actions
Camera - Set (Player((Integer A)))'s camera Distance to target to 477.93 over 0.00 seconds
Camera - Set (Player((Integer A)))'s camera Rotation to (Facing of playerscharacter[(Integer A)]) over 0.20 seconds
Camera - Lock camera target for (Player((Integer A))) to playerscharacter[(Integer A)], offset by (50.00, 0.00) using Default rotation
Camera - Change camera smoothing factor to 30.00
03-16-2006, 11:37 AM#2
iNfraNe
How about.. Camera - Pan Camera to point?

be sure to remove the leak with the point tho, since else itll lag up.
03-16-2006, 05:27 PM#3
Linera
I don't know how to trigger it so it keeps unit in the center of the screen.
the camera rotates with the unit's facing
03-16-2006, 05:32 PM#4
Captain Griffen
Once you lock it to the unit, the camera stays on that unit till you unlock it.
03-16-2006, 09:16 PM#5
Linera
when i lock the cam to the unit the unit is near the top of the screen when i want the unit to be more in the middle of the screen.
03-16-2006, 09:32 PM#6
Mordiggian
You have some sort of offsets in it. Or at least it sounds that way. Simply just put the trigger "Camera - Lock camera target to [unit]" or something like that and it will stay there.

Of course, it also depends on what camera you are locking in. Just make a camera the way you like it and then put "Apply [camera] object .. " before you lock it.
03-16-2006, 10:41 PM#7
Linera
I did apply camera and it still has unit near top of screen.
03-17-2006, 03:15 AM#8
paidan_fain
If the problem is with the locking to unit method, why not do what the first guy who posted said and have it pan to the location of the unit rather than the unit? It may not solve the problem but its worth a shot.
03-17-2006, 06:18 AM#9
Linera
but won't they be able to still scroll camera?
03-17-2006, 07:23 AM#10
Mordiggian
Not if it's locked. Only rolling "in and out" is allowed. And if you want to prevent that just made Periodic Event trigger (0.1 second or sumthing..).