This error disguised as a warning has no stack trace

This error is the worst. I’ve gotten it at some point in every project I’ve ever worked on, and I’ve never been able to fix it. It spams the output and doesn’t tell me what’s causing the problem so I have absolutely no way to debug it.

It needs to be turned into a real error and given a stack trace.

11 Likes

This error happens when you try to set the parent of something at the same time the parent is set by something else, try adding a wait.

2 Likes

I think the point of this post is not because the error itself is erroneous but because it’s shown as a warning instead of an error. This means it won’t give us a stack trace so it’s impossible to see which part of my script actually causes this error to occur.

It’s not something that should be a warning at all, it hasn’t done what we wanted it to do, so an error should be thrown instead. Think about it like this: I could be trying to set the parent of an object at different points in the script, if unfortunately they happen to try and set it at the same time only one of them will actually work and the warning will be thrown. It’s currently really hard to tell which one of the places they collided making it extremely hard to debug, especially if it’s in different scripts. With a stack trace, we could find the line which didn’t successfully run and find a way to avoid it.

1 Like

The nature of the warning is that setting the parent fires an event, which has a listener that immediately sets the parent again. It tells you the name of the object and the name of its current parent. Sounds like less than 5 minutes of searching, to me. I would agree that a stack trace would cut this time down substantially, though.

However, the warning does not need to be turned into an error for this reason. Doing so has separate consequences unrelated to stack tracing.