MCPcopy Create free account
hub / github.com/defold/defold / Script_SetRotation

Function Script_SetRotation

engine/gameobject/src/gameobject/gameobject_script.cpp:1023–1029  ·  view source on GitHub ↗

sets the rotation of the game object instance * The rotation is relative to the parent (if any). The global world rotation cannot be manually set. * * @name go.set_rotation * @param rotation [type:quaternion] rotation to set * @param [id] [type:string|hash|url] optional id of the game object instance to get the rotation for, by default the instance of the calling script

Source from the content-addressed store, hash-verified

1021 * ```
1022 */
1023 int Script_SetRotation(lua_State* L)
1024 {
1025 Instance* instance = ResolveInstance(L, 2);
1026 dmVMath::Quat* q = dmScript::CheckQuat(L, 1);
1027 dmGameObject::SetRotation(instance, *q);
1028 return 0;
1029 }
1030
1031 /*# sets the scale factor of the game object instance
1032 * The scale factor is relative to the parent (if any). The global world scale factor cannot be manually set.

Callers

nothing calls this directly

Calls 3

ResolveInstanceFunction · 0.85
CheckQuatFunction · 0.85
SetRotationFunction · 0.70

Tested by

no test coverage detected