• Create Account

## Animated 3d model (FBX format) gets stuck in running animation

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

3 replies to this topic

### #1lougv22  Members

371
Like
0Likes
Like

Posted 13 May 2012 - 12:34 PM

I am working on a simple third-person shooter game in XNA 4.0 Refresh and my character gets stuck in his Run animation. He takes about 2 steps and then kind of freezes for 15 seconds, then he takes another 2 steps and freezes again for 15 seconds and so on. I viewed the model in a FBX viewer for QuickTime and it did the same thing there so that leads me to think it's not something I am doing, but I can't be sure.

All the coding is done in Visual Studio 2010 Express, on a Windows 7 machine, using XNA 4.0 Refresh. I have my own custom Animation Writer and Reader.

Here is what the beginning frames of the animation look like:

And this is the pose that he gets stuck in for 15 seconds:

I've attached my AnimatedModel class in case somebody would like to take a look at it. Anybody has any idea what the problem might be?

### #2lougv22  Members

371
Like
0Likes
Like

Posted 17 May 2012 - 07:37 PM

Well no one seems to know the answer to this, so I am just going to post the solution I came up with. I found out that all 4 of my model's animations were imported with a duration of 12.5 seconds. I also found out that for the Run animation, the actual running part only spanned the first 1.32 seconds, the rest was him just sitting there looking like frozen in time. So what I did was simply reduce that animation's duration to 1.32 seconds and that seemed the solve the problem, i.e. he is running normally now.

This is all I had to do (in my AnimatedModel class):

// Reduce the duration of the Run animation for the Marine model, otherwise he gets
// stuck for most of it
if (modelFileName == "PlayerMarine")
_animatedModelData.Animations[1].Duration = new TimeSpan(0, 0, 0, 1, 320);


### #3hupsilardee  Members

491
Like
0Likes
Like

Posted 18 May 2012 - 06:40 AM

That's a pretty ugly hack/fix. What happens if every file needs a fix like that? The root problem is most likely in the FBX exporter, based on Quicktime giving the same problem. See if you can fix that.

Also, that's a really nice asset, where did you get it?

### #4lougv22  Members

371
Like
0Likes
Like

Posted 18 May 2012 - 08:06 AM

Well the thing is that I didn't export the model, I simply downloaded it from the website for a book I am reading (apress.com), so I have no way of re-exporting it or of fixing any problems there might be with the model itself.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.