Child entities don't inherit scene from parent, logs warning when killed
See original GitHub issueIt appears that child entities do not inherit this.scene
from its parent. I first noticed this when killing an actor with children and getting the following warning:
Cannot kill actor, it was never added to the Scene
After digging into it I noticed it was the child entity logging the warning, as this.scene
was null here:
If the child entities aren’t truly killed it’s possible this might be a memory leak, but I haven’t dug much further.
Steps to Reproduce
repro: https://codesandbox.io/s/exaclibur-child-entities-bug-5r0w3e?file=/src/index.js
- Add children to an actor via
actor.addChild()
- Kill the actor
- See the warning in console
Expected Result
Children should inherit scene from parent and no warning log should occur when killed
Actual Result
Children do not inherit scene and a warning is logged when parent is killed
Environment
- browsers and versions: Chrome 103.0.5060.114
- operating system: macoS 12.4
- Excalibur versions: 0.27
Current Workaround
None
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Inheritance and the prototype chain - JavaScript | MDN
When it comes to inheritance, JavaScript only has one construct: objects. Each object has a private property which holds a link to another ......
Read more >Hiding inherited public variable in the inspector? - Unity Forum
Is it possible to make a public inherited variable to not show up in the inspector? Its only needed in the parent class...
Read more >Inheritance of Febrile Seizures in Sudden Unexplained Death ...
Sudden unexplained death in toddlers has been associated with febrile seizures, family history of febrile seizures, and hippocampal anomalies.
Read more >Estate Planning Horrors: Don't Let Strangers Snatch Your ...
Under it, property goes first or in major part to a spouse then secondly to children and their descendants. When there are no...
Read more >How to make child process die after parent exits?
The child process is spawned in the background. The shell waits for a newline (or an EOF) then kills the child. When the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the fix! It’s amazing the speed of development on this project
I was just about to raise something similar, so good timing!
My suggestion was to improve the warning message to include the actor’s name to help narrow down the warning when it does pop up. But a fix to the underlying issue would also be ace.
Something like: