yeah. I want my chacter to pull out a sword from his back and put it back. help?
If you’re sword is just some random actor, attach/detach it to a socket/bone as you see fit.
Otherwise, look into creating some sort of inventory system that will do it for you.
- Create “pull out” and “put back” animations for the character. Mark the “in the back scabbard holding position” frame as an animation marker.
- Put a Socket on the character’s hand to put the sword in.
- Bind key P to play the pull-out animation, if not currently held. Set the held flag. When triggered, bind the animation marker to attach the sword entity to the socket on the hand.
- Bind key O to play the put-back animation, if currently held. Clear the held flag. When triggered, bind the animation marker to detach the sword from the socket, and attach to the back.
jwatte has a good flow of how that can be done.
I have a video link that will straight-up show you what jwatte just explained in a nutshell.
However, I have to wonder why they would have a sword in their back to begin with. That has to be quite painful, therefore why in the world would they want to put it back?