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