can it be that the .enabled attribute from the pc.entity got lost during the port to the new scripting system?
Its still in the documentation, but I cannot access it anymore in the engine.
I logged a few entities to the console, but the public .enabled attribute isnt there anymore.
Is there a new way to enable or disable entities now, or is the attribute just missing in action?
I made another test scene Martin, it does work here … I don’t know why it doesn’t work in our other project. edit: it just wasn’t triggered correct in our main project.
Thanks, but I think I figured it out for that project,
the function just wasn’t triggered correctly.
Martin might still have trouble with his project though.
Sounds like scope problem where this refers to something else, so you do: this.entity.enabled and actually this is not script, so it can’t refer to entity.
Please use Dev Tools with Breakpoints in Sources tab, that allows you to pause code and inspect variables.
Indeed, it seems to be something different, that causes the problem.
Although I cannot figure out what causes the problem yet.
I made a simple test script, which tries to disable all its children and tested that in two projects.
The same script works in a new created project, but not in my existing one.
The scope seems to be identical. I have also disabled all other scripts in the old project and tried the test project with a mesh from the old project. No clue what I am missing
This line is actually fine, what happens inside is a bit weird, it goes into internals and then tries to remove model from scene, and has to mark used materials as unused, but it fails to do so because one of meshInstances is not meshInstance, but empty array - weird.
Do you modify meshInstances of a model anywhere?
Yeah that’s the weird thing.
I disabled the static, but that’s not fixing the problem, but I think I found what’s causing the problem.
Thought I had disabled all other scripts in the scene, but I just noticed, that the turntable camera script is still active and that seems to cause the problem. If that’s disabled the rest works, now I just have to figure out what exactly is causing the error there
I am not manipulating any entities there, but I am looking up their positions and bounding box, to place the camera centered on the objects, I guess something in there is the root of the problem.
Soo time for more debugging
Thanks,
these models are more meant as examples for my report.
However, if I find the time for it, I would like to do a small scene, with a bit more tweaked visuals and an propper environment around it.