Yue Posted April 20 Posted April 20 I am creating a cube for my third person camera pivot. But the cube is not visible, although the camera is pivoting to its position. Camera3rdPerson = {} Camera3rdPerson.__index = Camera3rdPerson function Camera3rdPerson:New(world) local this = setmetatable({}, Camera3rdPerson) Print("✅ [Camera3rdPerson] Sistema de cámara orbital inicializado.") -- 🌌 Crear cámara vinculada al mundo local camera = CreateCamera(world:GetWorld()) camera:SetOrder(-1) -- Se renderiza primero camera:SetPosition(0,2,-2) local pivotCamera = CreateBox(world:GetWorld(), 0.2) pivotCamera:SetColor(1, 1, 0, 1) -- Amarillo brillante para debug pivotCamera:SetPosition(0, 2, 0,true) -- Altura media, ajustable luego camera:Point(pivotCamera) The cube is there, the camera is looking at it. function this:Update() --Print("📡 [Camera] Update activo en Nivel01.") pivotCamera:Move(0,0.001,0) end The cube is visible and starts to move upwards . Quote
Yue Posted April 20 Author Posted April 20 Temporary solution --------------------------------------------------- -- 🔁 Actualizar posición de la cámara cada frame --------------------------------------------------- function this:Update() --Print("📡 [Camera] Update activo en Nivel01.") if self._forceCheck then local _ = pivotCamera:GetHidden() self._forceCheck = false end end Quote
Josh Posted April 22 Posted April 22 In your code above pivotCamera is being declared as a local variable. The real mystery is how the program is not crashing in the Update method, since there is no global pivotCamera value declared? I need to see your whole code file to tell what is going on. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Yue Posted April 23 Author Posted April 23 4 hours ago, Josh said: In your code above pivotCamera is being declared as a local variable. The real mystery is how the program is not crashing in the Update method, since there is no global pivotCamera value declared? I need to see your whole code file to tell what is going on. Ok i sent the file by inbox Quote
Josh Posted April 23 Posted April 23 I don't see any error in your code. I will need to full project in order to investigate this. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.