Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Root motion #17

Open
arendhil opened this issue Sep 3, 2021 · 2 comments
Open

Root motion #17

arendhil opened this issue Sep 3, 2021 · 2 comments

Comments

@arendhil
Copy link

arendhil commented Sep 3, 2021

I've loved this Aseprite importer and it solve most of my problem with the adition of a few I didn't have.
Unfortunatelly, my project has a very fine pixel tuned animation based on root motion. So, I would need to add transformation to the root motion translating the pivot position change into the animation. I have no problem in doing this as a last pass on the animation. However, if I try to add the translation on the imported animations it starts to behave oddly changing the sprite in some of the keyframes for the animation.
Is there anyway to set that in aseprite or add it later somehow?
If you could guide me through the code, I may be able to write this transformation based on the pivot change in a given loop myself.

@arendhil
Copy link
Author

I've done it easily by changing the Settings and exposing a bool rootMotion and dealing with it after the pivot being set in the Spritesheet. However, for walks, interact, climb and anyother thing in contact with the floor we use constant AnimationCurve and for jumps we use Auto AnimationCurve.
At first, I tried doing a @pivot("root-constant") and a @pivot("root-curve"). However, the spritesheet pivot setting went nuts for having 2 layers trying to apply it and it didn't work.
I solved it (in an awful way) but I need suggestions on how to find a better solution. What I did that made everything work is use colors on the pixel painted for pivots. If it is red, the root-motion is AnimationCurve.Auto. All other cases are AnimationCurve.Constant.

@arendhil
Copy link
Author

Another problem I have is that I forked the repository and tried to use the last version on my project to make the changes directly on the last version to open Pull Request later. However, I got a few errors when trying to copy the Plugins folder to my project but I got a few errors and had to use the last unitypackage. So, the changes I made do not apply to the current version. As soon as I get it working on the latest repo version I'll link my fork over here if anyone else want to check/test and propose improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant