Jump to content

FindChild() issue


Rick
 Share

Recommended Posts

So in Lua I make a model a parent to a cube I create in Lua code. I then give it a setting where the key is "name" and the value is "cube". In C++ the model gets loaded in, but when I try to call FindChild(model, "cube") I get nothing. If I loop through all the children of the model there are 2 children (mesh & my cube). The name key is there.

 

I thought FindChild() read the key called "name" and returned with the first child with a given name matches, but in this case it seems like it's not. Any ideas why?

Link to comment
Share on other sites

I had the same problem, so I used a hardcoded GetChild(2) to get it to work.

 

I see this is a recent post, is this a bug?

 

Cause I try to use Findchild to retrieve the hand, but it gives an error that the Entity=Null

 

Blitzmax code I'm using

Player:TMesh = LoadMesh("Models\Playermodel.gmf")
If Not Player RuntimeError "Failed to load mesh."

Local PlayerRHand:TEntity = FindChild(Player, "Bip01 R Hand")
If Not PlayerRHand RuntimeError "Cannot find RHand Child"

 

So I must use something like this for now?

Local PlayerRHand:TEntity = Getchild(Player,<Int number of bone/child here>)

 

Edit:

I can use getchild on the First bone, and I used the settings in Ultimate Unwrap like explained in the tutorial including the bones. Could this also have to do with the treestructure I see in the bonelist?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...