Rick Posted October 13, 2010 Share Posted October 13, 2010 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? Quote Link to comment Share on other sites More sharing options...
Canardia Posted October 13, 2010 Share Posted October 13, 2010 I had the same problem, so I used a hardcoded GetChild(2) to get it to work. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Digital Anime Posted October 20, 2010 Share Posted October 20, 2010 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? Quote Link to comment Share on other sites More sharing options...
Digital Anime Posted October 20, 2010 Share Posted October 20, 2010 Seems like I have to do something like this with a tree structure and it seems to work for me. Local PlayerRHand:TEntity = getchild(getchild(getchild(getchild(getchild(getchild(getchild(Player, 1), 1), 3), 1), 2), 1), 1) It's not pretty, so I hope to be able to use findchild for this soon. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.