Sword as separate actor?
Mattcus
Member Posts: 85
Hi, I'm in the process of making a game about a Ninja, who uses a sword.
Since I'm planning on having several different swords to choose from (Probably purely cosmetic), would it be possible to have the sword as it's own actor, so I don't need hundreds of frames of animation with each of the different swords?
And have the sword move at the same time as the hands in the main actor (The Ninja) so it looks like he's holding it?
Thanks in advance.
Since I'm planning on having several different swords to choose from (Probably purely cosmetic), would it be possible to have the sword as it's own actor, so I don't need hundreds of frames of animation with each of the different swords?
And have the sword move at the same time as the hands in the main actor (The Ninja) so it looks like he's holding it?
Thanks in advance.
Comments
but you will need to constrain the sword his position to the ninja
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Yea I honestly don't know that it will constrain alone will properly work since it isn't like you can constrain it to a joint.
What I would do is take each sword and create the animation for the sword so it is the same number frames as your ninjas attack. This way you can set both his attack animation and the swords animation to the same FPS which should give you little if any delay and look smooth. Although I haven't tried this, I would probably make each sword image the exact same size as the ninja images. So for example if you were in photoshop you would put your sword on the ninja image and make the ninja not visible. You may however have to leave a hand on the handle.
Now you would constrain the sword actor to the same X and Y as your ninja. Now all you have to do is the same thing with each sword and just put in a Switch for whichever sword is equipped.
The nice thing is you don't necessarily have to have to have the image as the same size as your ninja all the time. For example, if you had a larger than normal sword you would just make sure to extend the bounding box behind your ninja as well to accommodate for the extra distance for the sword on the front.
With a little tweaking you could do the same thing with a smaller sword image size if you wanted to cut out excess bounding box. You will just have to constrain it to your ninja to accommodate the differences (Constrain NinjaX+40 etc). It will just take a tad more tweaking is all, but something like that should get you on the right track.
then move your anchor on your sword, and use orbit or rotate+move. the problem you will run into Is calculating the delay In time that it take to put the sword up and take it out.
P.s.you will need two rules one for if facing left one for if facing right. (or else the sword with be stuck in the samee position as you turn) or 8 rules if playing a top down game. just keep doing else if.
p.p.s. also the sword image should change from just a sword to a sword with an arm grabing it when slicing. at which time your gun holding arm needs to disappear. If the character does not hold a weapon while running. Just have two animations of running one with the arm , one without.