OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Serial Killer on 11 Dec 2005, 17:40:33

Title: Question about camera scripting
Post by: Serial Killer on 11 Dec 2005, 17:40:33
I have this line in my cutscene script

Quote
_camera camSetTarget ldr1
_camera camSetRelPos [-1,1,0]
_camera camSetFOV 0.485
_camera camCommit 0
@camCommitted _camera

It's working fine, but I want that the camera doesn't follow "ldr1". I just want the camera to go near him with SetRelPos command. How do I do this?
Title: Re:Question about camera scripting
Post by: THobson on 11 Dec 2005, 17:53:42
Try:

Code: [Select]
_pos = getPos ldr1
_camera camSetTarget ldr1
_camera camSetRelPos [-1,1,0]
_camera camSetTarget _pos
_camera camSetFOV 0.485
_camera camCommit 0
@camCommitted _camera

The reason for setting the target twice is so the camSetRelPos works as you expect (ie on the unit not on a map location)
Title: Re:Question about camera scripting
Post by: Serial Killer on 12 Dec 2005, 00:55:17
OK, it's working. Thank you very much.