   Childs inside Types in Blitz3D
  Everytime I try the retrieve the child of another entity inside a type I get a memory violation message.here's the code:p.Player=New Playerp\entity=CreatePivot()p\model=CopyEntity( player_model,p\entity )p\playerhead.Head = New Headp\playerhead\entity=GetChild(p\model,2)EntityAlpha p\playerhead\entity,0.5I tried nesting types and I get the same error. Is there any solution or Blitz just doesn't support childs inside types ?[Edited by - MikeDee on June 11, 2009 4:36:05 PM]
  Where to start?Firstly, this question would be massively better posted on the Blitz3D forums.Secondly, you've missed out half of your code. The type declaration is obviously where the error is but you haven't included it.Thirdly, if you're getting a Memory Access Violation on something like this, it sounds like you have the debugger disabled. When you're trying to find a bug, I'd highly recommend turning on the debugger.Finally, here are the Type declarations I made up to make your code work. I have no idea what they might be missing without you posting the rest of your code, but hopefully they will enable you to see your mistake.Type PlayerField Entity%Field Model%Field PlayerHead.headEnd TypeType HeadField Entity%End Type;  Oh I'm sorry I should've explained myself better, I did use the debugger and I got "Entity is not a model".The line that is causing this is "EntityAlpha p\playerhead\entity,0.5"So I assume the problem is when I use the GetChild command, it just doesn't seem to work and probably returns 0, so when I try to do something with the model, it just gives me an error because the model simply doesnt exist (is 0).Oh and the type declarations I have are exactly the same as the ones you did.   ;  You're correct. This is nothing to do with types, but is happening because the entity simply doesn't have a child with the index you're requesting.Again, we still don't have all the code, so I'm kinda flailing around in the dark a little here. One possibility is that you've loaded the mesh with LoadMesh() in which case there won't be any children. If you want to have a proper hierarchy with parents and children in your models, you must use LoadAnimMesh() (yes, even though there is no animation, it's a silly B3D naming convention.)The other possibility is that the model was not exported how you think it was. Personally, I find it much preferable to use FindChild() which lets you select the child by name instead of by index. Then you don't have to worry about how things are exported. Well, providing the names are exported correctly, I guess :P