I am developing a side scrolling beat em up game - something like final fight, streets of rage, or most ninja turtles games. I currently have jumping work by setting a state and then animation simply moves the character sprite renderer vertically while allowing for slightly altered movement when in that state. I would like to make an air attack that will start at whatever the current sprite renderer height is and then carry down as it normally would have if the jump was playing. Is there any good idea on how to do this? I made an AirAttack animation that starts at the height of the jump however, if you try to attack early or late, then you teleport, which isn’t right. Is there any way to grab the current height and then continue down as the animation parameters would have already? I had tried to set the localposition but it was returning an error that you are not able to change that.
I normally prefer to control height though code. So if you had a character like Ryu that does a hurricane kick while jumping then you can pass though the velocity. You can override values like localposiiton / position that are controlled by an animation by updating them in LateUpdate. You might be ok to add a center of mass point, record the global position, change to the attack animation and the offset the character by the center of mass position difference.
Since your making a sprite base game I’d recommend checking out Mugen. This has some good examples on creating this type of game. Also, if you can duplicate the format in Unity then you can use a range of premade characters for testing.
Ok thanks, I’m calling it a day for today but I’ll try this out tomorrow. I’ve seen mugen builds before, some of those can get wild.
Forgot to say this earlier but I was able to get it working with LateUpdate so now it acts how I like, thank you so much!