0
Answered

How do you find the amount of children attached to a game object

Doge Gamer 2 months ago • updated by Lazlo Bonin (Lead Developer) 2 months ago 10

I tried to find the code line but the closest thing I could find was checking if it was the child of a parent, instead of how many children it has. How do I check this?

Bolt Version:
2.0.05a
Unity Version:
2019.1.0f2
.NET Version:
GOOD, I'M SATISFIED
Satisfaction mark by Doge Gamer 2 months ago

Do I change component to whatever game object I’m using?

Edit: also thanks for the quick reply.

Second edit: Actually, I think I get it now. Nvm. Still thanks

You select what type of component you want to retrieve from children.

Ok, thanks! I have some scripts I’m trying to convert so this’ll help a lot.

I looked for the blocks you used and I couldn’t find any of them. Which bolt version are you using?

Wouldn't [Transform: Child Count] be easier/more-effective? (I'm assuming anyways)

Tried to find it... looked up child count and it didn’t show up

That's.. weird..

I know I've used that a bunch in Bolt 1.4 and I find no reason why they might have removed it in 2.0...?

https://docs.unity3d.com/ScriptReference/Transform-childCount.html

+1

I’m using human naming though. That might be what’s wrong

Edit: Wait. I found the get child count block.

Answered

Glad you sorted this out! :)