How can I change the parent of a scene node to have no parent?
I tried ->setParent(0);
but then after that if i then try to change the parent again it crashes.
remove parent
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: remove parent
It crashes because its parent is the only thing that has a reference to it. Without a parent, it gets deleted at the end of setParent(0).Papa Lazarou wrote:How can I change the parent of a scene node to have no parent?
I tried ->setParent(0);
but then after that if i then try to change the parent again it crashes.
Call node->grab() before node->setParent(0) so that your app holds a reference to it, and then node->drop() after you set a valid parent.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way