Giter Site home page Giter Site logo

Comments (9)

AThousandShips avatar AThousandShips commented on September 17, 2024 1

The owner is reset on changing the parent, everything works as designed, so it's something to discuss as a proposal for changing behaviour, not something that's broken or a bug, see here, if you want the owner to be preserved use reparent instead

from godot.

AThousandShips avatar AThousandShips commented on September 17, 2024

Does it work with find_children("Head", "", true, false)?

from godot.

Voaz avatar Voaz commented on September 17, 2024

find_child("Head", "", true, false) says too many arguments, but it works like this (I suppose that what you meant to check): find_child("Head", true, false)

from godot.

AThousandShips avatar AThousandShips commented on September 17, 2024

Meant find_children my bad, but yes find_child("Head", true, false)

from godot.

Voaz avatar Voaz commented on September 17, 2024

got it, I checked also other variants:
find_child("Head", false, false) - works
find_child("Head", true, false) - works
find_child("Head", true, true) - doesn't
find_children("Head", "", false, true) - doesn't
find_children("Head", "", false, false) - works

from godot.

AThousandShips avatar AThousandShips commented on September 17, 2024

Then it's expected, you haven't set the owner, the last argument filters only for owned nodes:

If owned is true, only descendants with a valid owner node are checked.

from godot.

Voaz avatar Voaz commented on September 17, 2024

I see, thank you very much @AThousandShips !
IMO: I have to say that it's counterintuitive. I never before was setting owner and it's unclear why it's true by default in find_child.
it is very contradicting when you clearly see it in the tree but find_child gives you null result nevertheless it IS still a child and it is in the tree but the owner is not set...
if so player.get_children() should also give null result and have a owned argument otherwise it's misleading.

from godot.

AThousandShips avatar AThousandShips commented on September 17, 2024

Please open a proposal for that, this is not a bug, but the argument can't be changed to false by default without breaking compatibility so won't happen in 4.x I'd say

from godot.

Voaz avatar Voaz commented on September 17, 2024

I believe needs to be reopen because the behavior is inconsistent. it's not only about find_child but the whole chain of actions.
if I do the same find_child before changing it's parent - it works. but if I change the parent and then return back to original parent - it doesn't work.

from godot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.