Jump to content

Recommended Posts

Posted

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)

 

image.thumb.png.78d72232e6db8a0421992378dad9df2f.png

 

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



image.thumb.png.cf371ef644c9b22983d1d0023a611281.png

 

The cube is visible and starts to move upwards . 

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Posted

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

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Posted

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.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted
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

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Posted

I don't see any error in your code. I will need to full project in order to investigate this.

My job is to make tools you love, with the features you want, and performance you can't live without.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...