I'm trying to use the bone positions of a model to create a virtual version to store in a table, but it's failing to get the correct bone positions, making the calculation impossible. I have tried changing the model, and I have tried changing the code, but nothing works. What is weird is that it worked for one of the models yesterday, but today it works for neither of them. Is there something wrong with my model that makes it impossible to get the correct bone positions, or am I not using the code right? This is the last big bug in my work and I would really like to get it fixed.
Here is the code I used to grab the bones:
[code]
self.bones = {}
local E = self.Entity
for i=1,3 do
local p1,a1 = E:GetBonePosition(i-1)
local p2,a2 = E:GetBonePosition(i)
self.bones[i] = E:WorldToLocal( E:GetPos() + (p2-p1) )
print(self.bones[i])
end
[/code]
And here is a zip file containing everything about the model itself:
[url]https://dl.dropboxusercontent.com/u/96659343/light_turret.zip[/url]
Sorry, you need to Log In to post a reply to this thread.