diedir Posted October 27, 2023 Share Posted October 27, 2023 Hello, need to retrieve entities.count world:CountEntities() don't seem to work, if someone knows how to enumerate the world entities... thank you Quote AMD Ryzen 5900HX - Nvidia RTX 3070 - 32 Go - 1To SSD - W11 Link to comment Share on other sites More sharing options...
Josh Posted October 27, 2023 Share Posted October 27, 2023 The world does not store a list of entities, but the map object that is returned by LoadMap does. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
diedir Posted October 27, 2023 Author Share Posted October 27, 2023 sorry i tried with scene and error occured: local scene = LoadMap(world, mapname) for x=0,scene:CountEntities()-1 do local entity = scene:GetEntity(x) local name = entity:GetKeyValue("name") if name == "cube1" then.....etc Quote AMD Ryzen 5900HX - Nvidia RTX 3070 - 32 Go - 1To SSD - W11 Link to comment Share on other sites More sharing options...
Josh Posted October 27, 2023 Share Posted October 27, 2023 What engine are you using? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
diedir Posted October 27, 2023 Author Share Posted October 27, 2023 Ultra Engine obviously 1 Quote AMD Ryzen 5900HX - Nvidia RTX 3070 - 32 Go - 1To SSD - W11 Link to comment Share on other sites More sharing options...
Solution Josh Posted October 27, 2023 Solution Share Posted October 27, 2023 for n = 1, #scene.entities do entity = scene.entities[n] end Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
diedir Posted October 27, 2023 Author Share Posted October 27, 2023 thank you Josh Quote AMD Ryzen 5900HX - Nvidia RTX 3070 - 32 Go - 1To SSD - W11 Link to comment Share on other sites More sharing options...
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.