camSetDir: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(command now works, description, example)
Line 11: Line 11:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Set the direction of the given camera. Needs the call of [[camCommit]] to be conducted.
| Set the direction of the given camera in the direction of the given vector. Needs the call of [[camCommit]] to be conducted. |= Description
{{warning | This command is completely broken}} |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 19: Line 18:
|p1= camera: [[Object]] - object of type "camera" |= Parameter 1
|p1= camera: [[Object]] - object of type "camera" |= Parameter 1


|p2= direction: (Prior to Arma 3) [[Number]] - direction in degrees, range 0 to 360.
|p2= direction: [[Array]] in format [x,y,z] - direction of camera. Must be a valid vector. |= Parameter 2
 
|p3= direction: (Since Arma 3) [[Array]] - direction of camera |= Parameter 2


| [[Nothing]] |= Return value
| [[Nothing]] |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <pre>_cam camSetDir 90</pre> |= Example 1
|x1= <code>pos1 = [[player]] [[modelToWorld]] [0,5,5];
cam = "camera" [[camCreate]] pos1;
cam [[cameraEffect]] ["EXTERNAL", "BACK"];
pos2 = [[player]] [[modelToWorld]] [0,50,50];
cam [[camSetPos]] pos2;
cam [[camSetDir]] (pos2 [[vectorFromTo]] pos1);
cam [[camCommit]] 5;
[] [[spawn]]
{
[[waitUntil]] {[[camCommitted]] cam};
cam [[camSetPos]] pos1;
cam [[camCommit]] 5;
}</code> |= Example 1
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 35: Line 44:
<h3 style="display:none">Notes</h3>
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on June 11, 2007
<dt class="note">'''[[User:SR|SR]]'''
<dd class="note"> This command does NOT work on cameras (in ArmA 1.05 at least), use SetDir instead.
<dd class="notedate">Posted on June 11, 2013
<dt class="note">'''[[User:Ceeeb|Ceeeb]]'''
<dd class="note"> This command (with new syntax) is also broken in the Arma 3 Alpha, see [http://feedback.arma3.com/view.php?id=7814 this feedback tracker report]
<dd class="notedate">Posted on March 1, 2016
<dt class="note">'''[[User:talkingtoaj|talkingtoaj]]'''
<dd class="note"> Yep, still broken.
<!-- Note Section END -->


</dl>
</dl>
Line 62: Line 58:
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Broken Scripting Commands|{{uc:{{PAGENAME}}}}]]

Revision as of 20:27, 9 May 2016

Hover & click on the images for description

Description

Description:
Set the direction of the given camera in the direction of the given vector. Needs the call of camCommit to be conducted.
Groups:
Uncategorised

Syntax

Syntax:
camera camSetDir direction
Parameters:
camera: Object - object of type "camera"
direction: Array in format [x,y,z] - direction of camera. Must be a valid vector.
Return Value:
Nothing

Examples

Example 1:
pos1 = player modelToWorld [0,5,5]; cam = "camera" camCreate pos1; cam cameraEffect ["EXTERNAL", "BACK"]; pos2 = player modelToWorld [0,50,50]; cam camSetPos pos2; cam camSetDir (pos2 vectorFromTo pos1); cam camCommit 5; [] spawn { waitUntil {camCommitted cam}; cam camSetPos pos1; cam camCommit 5; }

Additional Information

See also:
directionsetDircamSetTarget

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section