solitarysoftworks

Hello!

I'm having issues switching through animations with Corona SDK. I've figured out how to switch the animations when needed, however the end result is incorrect. The bones are stuttering, incorrect frame order and incorrect positioning. Thanks.


function update(e)

local currentTime = e.time / 1000
local delta = currentTime - lastTime
lastTime = currentTime
animationTime = animationTime + delta
player:updateWorldTransform()

if(aniState == 1) then
aniHolder[1]:apply(player, animationTime, true)
elseif(aniState == 2) then
aniHolder[2]:apply(player, animationTime, true)
elseif(aniState == 3) then
aniHolder[3]:apply(player, animationTime, true)
end

if(playerStun == false and pGrounded[1] == false) then
aniState = 3
elseif(playerStun == false and pGrounded[1] == true) then
aniState = 1
end

if(playerStun == true) then
aniState = 2
end

end


EDIT:
I'd also like to mention I'm trying to get each animation to play in a loop.
solitarysoftworks
  • Mesajlar: 8

Søren

Have you checked this part of the runtime documentation http://esotericsoftware.com/spine-using ... animations ?

Moving this to the runtime section.
Kullanıcı avatarı
Søren

Shiu
  • Mesajlar: 2452

solitarysoftworks

Thank Shiu! I actually overlooked pretty much all of the new documentation you guys have added. Haha! I'm glad you guys have expanded on the documentation. It should prove useful, I will check it out.
solitarysoftworks
  • Mesajlar: 8

Nate

It may be that you need to key bones at the start of a new animation or call setToSetupPose between animations. Animations only change bones they have keys for, so a previous animation might leave the skeleton in a strange state when the next animation plays.
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 12032

Nate

Try using AnimationState, which was just added to spine-lua. Example:
https://github.com/EsotericSoftware/spi ... in.lua#L25
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 12032

solitarysoftworks

Sorry, just now noticed the reply to this thread. It was definitely setToSetupPose not being called when the animations changed. Thanks for adding AnimationState to the lua version. I'll switch over to that method since its likely more efficient.
solitarysoftworks
  • Mesajlar: 8


Dön Runtimes