Hello,
there is still an issue with this bug. I looked into "AnimationState.lua" file and came up with the following.
Firstly in "_animationsChanged" function. You changed:
for i, entry in pairs(self.tracks) do
to:
while i <= numTracks do
current = tracks[i]
but you still try to mix with "entry", which was renamed to "current":
if entry then
while entry.mixingFrom do
entry = entry.mixingFrom
end
repeat
if (entry.mixingTo == nil or entry.mixBlend ~= MixBlend.add) then
self:computeHold(entry)
end
entry = entry.mixingTo
until (entry == nil)
end
And second one - "#tracks" only works if there are no empty tracks.
So lets say that we have multiple tracks: one for original animation, one for sitting (for legs) and one for face. Not all tracks are active at all times. If he is standing then we use original animation on track 1 and face on track 3. Because track 2 is empty "#tracks" will return 1 so it will also skip track 3.
This returns the correct length of tracks array:
local function getNumTracks(tracks)
local numTracks = 0
if tracks then
for i, track in pairs(tracks) do
if i > numTracks then
numTracks = i
end
end
end
return numTracks
end
local numTracks = getNumTracks(tracks)