Character sword on back equip
Hi there i am quite new to Unity and i am wondering how you would be able to have a sword stay still on your back and follow character movements e.g character runs and sword follows but goes up and down a bit then press a button to equip sword triggering animation of hand picking sword up and then able to un-equip (put back in scabbard) which triggers animation in reverse.
Thanks all help is appreciated :-)
Answer by hexagonius · Jan 28, 2017 at 01:26 PM
First, you need a gameobject on your characters hierarchy that matches your requirements for a proper animated position on the back of the character (could also be the torso directy, if the actual back does not move relative to it too much, like through skinning. Then you'd need to place another bone to the back, staying with it).
I'd add another gameobject to it, placed in the exact spot and rotation the sword would need to be. parenting it via could then is just setting the localposition to 0 and the rotation likewise.
For the bouncing, just code a little up and down, reading from the speed the character is animating its walkcycle with.
For the pick and put back animations, just make sure the hand of the character reaches for the tip of the sword on the pack and the moment it's either of the situations, attach or detach the sword from/ to the hand/ back socket.
I understand now after reading a few times and sry if i took to long i forgot about this thanks everything works now :-)
Answer by AverageCoder · Jan 28, 2017 at 03:30 PM
I am not so good at coding and I am kind of a dummy and I don't understand what's going on is there any video demonstration Please
Thanks
Your answer
Follow this Question
Related Questions
Why is my character not switching through animations when buttons are pressed? 0 Answers
How to play animation in new scene on button press? 0 Answers
How to play individual Timeline clips, step-by-step per button press? 1 Answer
Button won't play my all mesh animation. 0 Answers
Unity 5.3.4f1 Inconsistent Animation times between mobile devices. 0 Answers