Game Development Community

changing character's animations?

by David · in Game Design and Creative Issues · 07/20/2014 (3:31 pm) · 8 replies

Im trying to figure out how to make my character do a different animation when he sprints opposes to when he runs. If someone could just tell me what folder to look in that would be awesome. I couldn't find it in default.bind.cs, player.cs, or in my chracater.cs, and my my character.cs is my list of animations for my character

#1
07/20/2014 (5:45 pm)
Hey David,

One quick way to do this is to select your player model by switching first to camera view (Alt+C). Then go to Shape Editor (Editors->Shape Editor). You can edit and save your character animation in there.

Here's the soldier animation set and preview under Shape Editor.

i.imgur.com/H78SVJbl.jpg
#2
07/20/2014 (6:18 pm)
no Ron, what your showing me is the animations thats in my character.cs. I made my sprint cycle already. now I want the animation to play when I sprint. when I press crouch he crouches, but when I press sprint he goes faster but the animation doesn't play. I already made my animations and my guy walks around fine, he just doesn't do the sprint animation

and my sprint cycle is labeled "Sprint"

**I want to fix my movements controls with my animations**
#3
07/21/2014 (6:41 am)
Export the animation sequence to its own DAE file, edit your character's script and add the animation there - just like the soldier:
function SoldierDAE::onLoad(%this)
{
   // BEGIN: Default (Lurker Rifle) Sequences
   %this.addSequence( "./Anims/PlayerAnim_Lurker_Back.dae Back", "Back", 0, -1);
   %this.addSequence( "./Anims/PlayerAnim_WHATEVER.dae Back", "WHATEVER", 0, -1);
...
   %this.setSequenceCyclic( "WHATEVER", true);
...   
   %this.setSequenceGroundSpeed( "WHATEVER", "0 -3.6 0");
}
#4
07/21/2014 (9:07 am)
no Richard, again that's my character.cs

im trying to make it so when u press a button it plays whatever the animation is. The default.bind.cs only deals with then movements, not the animations
#5
07/21/2014 (11:32 am)
Right, so all you need to do is play the right thread.

default.bind.cs does not 'only deal with movements', it's a script file just like any other .cs file. Create a function that plays your animation thread and call to it with a keybind.

Here's an example:
function Soldier::Sprint(%this, %soldier)
{
   %soldier.playThread(1, "Sprint");
}

In the above, the "Sprint" animation is setup on thread 1. You also may want to schedule the action. Oh, and replace 'Soldier' with your player's datablock.
#6
07/21/2014 (12:41 pm)
I've got an idea - delete all of that from your character.cs and let us know what happens....

Each of those DAE files contains the data for the animation that is associated with the named "movement."

Then, as Jesse pointed out, you have to tell the system to play the animation you want.
#7
07/22/2014 (8:49 pm)
ok I figured it out. thanks you to everyone who took the time to try to help. :)
#8
07/22/2014 (10:03 pm)
Post your solution? Pretty much the entire process for playing an animation on demand is outlined in this thread.

I'm just curious as to what you figured out that wasn't explained here, and why you've thanked us all for 'trying' to help. If there is something we've overlooked, by all means please share it here so the next guy doesn't stumble on it...