Jump to content

Recommended Posts

Posted

[1] 

When you have one camera in scene then is possible rename camera in inspector.

But when you add second camera to scene and name is changed on second camera too, from this moment you can't rename any cameras in inspector.

 

EDIT: Try delete first chars from entity name and pres ENTER => name is not changed, but when you add char at end, then name is changed. Looks like name is change only if char is added, but not when is any deleted.

[2] 
When you have i.e. 2 cameras in scene, then first added camera is MAIN (it's OK), but when this camera is set to hidden in inspector, then second added camera is not automaticaly activated for projection after run map. I tried this fix in script but 

...
local entities = game.world:GetEntities()
for n = 1, #entities do
    print(entities[n].name)
    if entities[n].name == "DebugCamera" then
        print("DEBUG camera exist ...")        
        entities[n]:SetProjectionMode(PROJECTION_PERSPECTIVE)
    end
    if entities[n].name == "Camera" then
        print("MAIN camera exist ...")        
        entities[n]:SetProjectionMode(PROJECTION_NONE)
    end
end
...

vhere n is ID to second camera, script crash with error attempt to call a nil value (method 'SetProjectionMode')

  • Thanks 1

"... programmig is art ..."

 

Posted

This is one mistake:

entities[n]:SetProjectionMode(PROJECTION_PERSPECTIVE) 

The entity should be cast to a camera before calling camera commands:

local camera = Camera(entities[n])
camera:SetProjectionMode(PROJECTION_PERSPECTIVE) 

 

Let's build cool stuff and have fun. :)

Posted
On 1/31/2026 at 1:09 AM, AndyGFX said:

When you have one camera in scene then is possible rename camera in inspector.

But when you add second camera to scene and name is changed on second camera too, from this moment you can't rename any cameras in inspector.

EDIT: Try delete first chars from entity name and pres ENTER => name is not changed, but when you add char at end, then name is changed. Looks like name is change only if char is added, but not when is any deleted.

I don't seem to have any problems renaming cameras in the editor. Is it possible to post a video showing the steps I should take to make an error occur?

image.thumb.png.a628bd29ee89419901b8ad06c3f406b6.png

Let's build cool stuff and have fun. :)

Posted

Yes works but only if you use [Backspace] key. Try it delete selected text with key [DEL] then is deleted text only in textfield name and when you press [ENTER], name of entity is not changed to current text in textfierld name.

image.png.4c38ecc07e590a855f5fefea4d9ebd86.png

"... programmig is art ..."

 

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...