Scripting/Squirrel/Functions/Object.Rotation: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "Read-only rotation property of an object. ==Syntax== <pre> object.Rotation </pre> object.Rotation is an Quaternion so you can use : <pre> object.Rotation.x </pre> <pre> obje...")
 
 
(One intermediate revision by the same user not shown)
Line 13: Line 13:


==Example==
==Example==
<pre> Message(FindObject(1).Rotation() </pre>
<pre> Message(FindObject(1).Rotation+"") </pre>


==Notes==
==Notes==
To rotate a object use [[Scripting/Squirrel/Functions/Object.RotateTo|RotateTo]] or [[http://wiki.vc-mp.org/index.php?title=Scripting/Squirrel/Functions/Object.RotateToEuler|RotateToEuler]] methods.
To rotate a object use [[Scripting/Squirrel/Functions/Object.RotateTo|RotateTo]] or [[Scripting/Squirrel/Functions/Object.RotateToEuler|RotateToEuler]] methods.





Latest revision as of 11:38, 2 June 2019

Read-only rotation property of an object.

Syntax

 object.Rotation 

object.Rotation is an Quaternion so you can use :

 object.Rotation.x 
 object.Rotation.y 
 object.Rotation.z 
 object.Rotation.w 

Since it is read-only you cannot use

object.Rotation = Quaternion(0,0,0,1) // <-- read only, the thrown error is: Error: Member Variable not found.

for example.

Example

 Message(FindObject(1).Rotation+"") 

Notes

To rotate a object use RotateTo or RotateToEuler methods.


Related Functions