- Home /
Getting transform info after branch
I only want to 'get child' after the game object has 8 children, so only after the branch. But the transform get child just keeps searching for the child that is not there in the beginning. It gives me so much error messages because there is no 7th child. How do I only us 'get child' after I have a 7th child?
Answer by CodeMonkeyYT · Apr 18 at 07:25 PM
What does that script look like while the game is running? What value is coming out of Get Child Count?
Everything looks correct, the Transform Get Child node should only run if that object has exactly 8 children.
When the code is running, the count child is 7. So it is false. But the transform get child node just keeps searching for the child. The code works properly but I still keep getting error messages and the transform node is red.
That Transform Get Child node is red? And the boolean is outputting false? That can't be right, if the bool is false then there will be no flow in the Branch True output and no flow going into Get Child
Can you post a screenshot with the game running?
Your answer
Follow this Question
Related Questions
Why do we access children through an object's transform? 2 Answers
transform.childCount == 0, but a child shows up in the hierarchy. How is this possible? 2 Answers
all parents of a transform 1 Answer
Child-objects are not properly 'transformed' with parent 1 Answer
Get components in children and childrens children and so on 1 Answer