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

Function Script_GetRotation

engine/gameobject/src/gameobject/gameobject_script.cpp:910–915  ·  view source on GitHub ↗

gets the rotation of the game object instance * The rotation is relative to the parent (if any). Use [ref:go.get_world_rotation] to retrieve the global world rotation. * * @name go.get_rotation * @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 * @return rotation [type:quaterni

Source from the content-addressed store, hash-verified

908 * ```
909 */
910 int Script_GetRotation(lua_State* L)
911 {
912 Instance* instance = ResolveInstance(L, 1);
913 dmScript::PushQuat(L, dmGameObject::GetRotation(instance));
914 return 1;
915 }
916
917 /*# gets the 3D scale factor of the game object instance
918 * The scale is relative the parent (if any). Use [ref:go.get_world_scale] to retrieve the global world 3D scale factor.

Callers

nothing calls this directly

Calls 3

ResolveInstanceFunction · 0.85
PushQuatFunction · 0.85
GetRotationFunction · 0.85

Tested by

no test coverage detected