Help needed in fixing character animation

Thank you very much!

OK, all ready! This one is considerably different than the previous (in code), so get ready to revamp your game code quite a bit if you choose to use this method.

https://docs.coronalabs.com/tutorial/events/continuousActions/index.html

Brent

Wow, thanks so much! I’ll start implementing right away!

Hi Brent, everything seems to be working ok except for one thing if I click on an area that is not on my button but still within the group region it jumps. Meaning that when I came to test the sliding: 

https://www.youtube.com/watch?v=GX4k7jRmE1w&feature=youtu.be

Notice how the character jumps when I press and then starts moving when my mouse reaches the button? Also, here is the area that my groupRegion covers:

Does this occur on your side too?

Never mind I fixed it, just added an extra return true statement. 

local function functionDirectionalKeys(event) local touchOverButton = detectButton(event) if event.phase == "began" then --etc. etc. elseif ( event.phase == "ended" and directionalKeyGroup.activeButton ~= nil ) then directionalKeyGroup.activeButton = nil anim:setLinearVelocity(0, 0) anim:setSequence("idle") anim:play() return true end return true --extra return statement end

Thanks for everything Brent, now it works completely! 

I can finally wrap up this topic.

Great to hear! Let me know if you encounter any other oddities. I think the tutorial nails all of them, but there may be some outside edge case I didn’t consider.

Brent

None yet, so far!

Hey there, Brent, I have been able to get the character to continue sliding on Live Builds. Here is the APK, so you can see for yourself:

https://github.com/sdktester15/SlidingProblem

When you have time, please fiddle around with the controls until you are able to get the character to slide. :slight_smile: