attaching an entity to a bone?
Blitz3D Forums/Blitz3D Beginners Area/attaching an entity to a bone?
| ||
Is it possible to attach entities to bones in a model's hierarchy? I've searched in the forums and the documentation and can't find an example. What I want to do is make a swinging light- by attaching a light entity to the end bone of an animated rope/cable. The end effect I am looking for is that when a FPS player shoots a hanging light fixture the fixture and the light start swaying around together. Is such a thing possible with this engine? |
| ||
Yes, you should first find out what the name of the bone is: After that, use this name to get the bone using FindChild. Then attach something to it using EntityParent. bone = FindChild(model, "box01") sphere = createsphere() entityparent sphere, bone positionentity sphere, 0, 0, 0 If you attach something to a bone, the child will be deformed by the parents matrix: it will follow it's scale, rotation and position. Last edited 2011 |
| ||
you may be able to prevent scaling etc. of the sword when you unparent it while you are scaling the character. |