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
mNo edit summary
 
Line 13: Line 13:


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


==Notes==
==Notes==

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