yurembo Posted January 8 Posted January 8 How to get an object (which was made in the editor) from the scene to control it programmatically (from a script)? Quote
Josh Posted January 8 Posted January 8 https://www.leadwerks.com/learn/Scene_GetEntity 1 Quote Let's build cool stuff and have fun.
yurembo Posted January 9 Author Posted January 9 @Josh Unfortunately, the documentation for the Scene class is very short. There's only one example for the LoadScene method. When running, it produces an error: This example shows how to create a Scene object in code, but the question remains: how to retrieve it from a map file, which was created in the editor? Scene:GetEntity is described well. Is the UUID always unique? Does it never change? How is it generated? Is it some kind of COM identifier? Quote
yurembo Posted January 9 Author Posted January 9 this transformation does not work: mesh = NavMesh(nav_mesh)-- nav_mesh is Entity, but NavMesh s = type(mesh)-- s = nil Quote
Josh Posted January 9 Posted January 9 Navmeshes are stored in the scene. See the Monster script for an example. Quote Let's build cool stuff and have fun.
yurembo Posted January 9 Author Posted January 9 OK, I'll consider this file. How can I get a map from the file? While I'm reading the source code I see that Map and Scene are the same. Quote
Solution Josh Posted January 9 Solution Posted January 9 The scene object is passed in the script Load function. You can get the navmesh there. 1 Quote Let's build cool stuff and have fun.
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.