From 03c18842f839718ed9a72824b190011d8d8be847 Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Wed, 9 Aug 2023 00:32:30 -0400 Subject: [PATCH] Fixed set translation --- Nuake/src/Scripting/Modules/SceneModule.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Nuake/src/Scripting/Modules/SceneModule.h b/Nuake/src/Scripting/Modules/SceneModule.h index c2f6708f..0a9cae0e 100644 --- a/Nuake/src/Scripting/Modules/SceneModule.h +++ b/Nuake/src/Scripting/Modules/SceneModule.h @@ -311,7 +311,7 @@ namespace Nuake Entity ent = Entity((entt::entity)handle, Engine::GetCurrentScene().get()); auto& transform = ent.GetComponent(); // set the slots - Vector3 position = transform.GetLocalPosition(); + Vector3 position = transform.GetGlobalPosition(); wrenSetSlotDouble(vm, 1, position.x); wrenSetSlotDouble(vm, 2, position.y); wrenSetSlotDouble(vm, 3, position.z); @@ -377,8 +377,7 @@ namespace Nuake double x = wrenGetSlotDouble(vm, 2); double y = wrenGetSlotDouble(vm, 3); double z = wrenGetSlotDouble(vm, 4); - - transform.SetGlobalPosition(Vector3(x, y, z)); + transform.SetLocalPosition(Vector3(x, y, z)); } static void TriggerGetOverlappingBodyCount(WrenVM* vm)