Armory: Get Child returns the parent name

Created on 7 Sep 2020  路  2Comments  路  Source: armory3d/armory

Parent and child names starts with Cube. The node returns only the parent name. Both objects are deleted because when the parent is deleted, child is too.

getchild.zip

bug logic nodes

Most helpful comment

Thank you for reporting @knowledgenude

This behavior of the logic node is because the code searches for the children's' children too. Not just one layer of child objects but every layer.

I guess this will cause confusion since even if an object has a child with a particular name, another object somewhere at a lower level will be returned.

image

In the example above, the user might expect to get the object C at Layer 1 when searched using starts with C but instead gets C1 at Layer 2.

One way to solve this is to remove the search for children's children and instead use the search node again on the child object.

Edit: This also improves searching, since the search nodes can be used in different combinations. I can make changes if there are no objections.

All 2 comments

Thank you for reporting @knowledgenude

This behavior of the logic node is because the code searches for the children's' children too. Not just one layer of child objects but every layer.

I guess this will cause confusion since even if an object has a child with a particular name, another object somewhere at a lower level will be returned.

image

In the example above, the user might expect to get the object C at Layer 1 when searched using starts with C but instead gets C1 at Layer 2.

One way to solve this is to remove the search for children's children and instead use the search node again on the child object.

Edit: This also improves searching, since the search nodes can be used in different combinations. I can make changes if there are no objections.

For me i don't see any need to search for the child of the child. If this is required, just use a node for search the child of the parent and another to search for the child of the child.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Amir-Arsalan picture Amir-Arsalan  路  4Comments

e1e5en-gd picture e1e5en-gd  路  3Comments

DevMagicLord picture DevMagicLord  路  3Comments

knowledgenude picture knowledgenude  路  3Comments

AttSee picture AttSee  路  4Comments