- Home /
2d character animation changing in-game
I am trying to make a 2d game where the size of the player changes over time but this happens because pieces are added to the different skeletal pieces of the player. The problem I'm having is that the animation system in unity uses absolute positions and i need to move my head up and arms out (etc.) so that the body parts can keep growing in size, but the animation still wants to snap back to its original position. Does anyone know of a way to change the separation of the pieces of an animation like this so that the starting location can change in the animation and the movements happen relative to that?
Answer by Thejimster82 · Aug 11, 2017 at 08:46 PM
I ended up just making copies of all of my body parts and then using a script to put them in the location of the body parts and then removed the sprites from the original body parts.
Looking back at this solution, it isn't ideal as it means manually moving a rigidbody and collider every frame which adds a significant amount of lag (~5ms per frame). I am trying to fix it using transform.localScale = transform.localScale but that doesn't seem to work either. Still need help with this, I wish unity just had a feature to disable position, rotation, or scale when it comes to parenting.
Your answer
Follow this Question
Related Questions
Where could I start with making a level editor where you can create your own terrain in Unity 2D? 0 Answers
Why my 2d sprite animation not working as i want? 1 Answer
Why is the jump animation not working? 1 Answer
can 2 different game objects join together into 1 animation? 0 Answers
Switch Players during play 2 Answers