Skip to content

format

typescript
Quaternion.Set(index, value)

class: Quaternion

description

Set the component of the quaternion based on the index.

parameter

param_nametypedescription
indexnumber0 for x component, 1 for y component, 2 for z component, 3 for w component.
valuenumberthe value of the corresponding component.

reture

typedescription
void

code example

typescript
function QuaternionTest (){
    let identity = Quaternion.identity;
    for(let i = 0; i < 4; i++)
    {
        identity.Set(i, i);
        Debug.Log(identity.Get(i));
    }
}