• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Mike 12 · Dec 08, 2010 at 03:21 AM · animationfbx

How to Get an FBX Model to Play Animations when the Animations are Split?

I've imported a model I found on the internet, and when imported into Unity without the animations being split, it plays fine. When the animations are split, they don't play, but I assume that I would need a script to play them. But, when I attach a script to play the animations to my game object, nothing happens.

I think that the name of the animations is correct, because I think that if my script tried to access these animations with the name being incorrect then it would give me some sort of Null Reference error. Can someone who has experience splitting FBX models' animations and then calling those animations from within a script help me with my problem? Thanks in advanced.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image johankool · Apr 23, 2012 at 04:00 PM 0
Share

I am facing this same issue. Anyone else with some more pointers on how to fix this?

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Paulius-Liekis · Dec 08, 2010 at 10:13 AM

Hard to say anything about the script without seeing it - it can do basically anything ;)

If you're concerned about splitting you can always change defaultClip on Animation component and on your GameObject. If you have "Play Automatically" then that GameObject will play defaultClip when you hil "Play" button.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Mike 12 · Dec 08, 2010 at 04:00 PM

I tried a simple script like the following, and it didn't work. Keep in mind, this is when I split a single animation - not use different animations from different versions of the same model from different files.

function Start () { StartCoroutine("TestPlay"); }

function TestPlay() { animation.Play("idle"); yield WaitForSeconds(animation.clip.length); animation.Play("aim 1"); yield WaitForSeconds(animation.clip.length); animation.Play("run 1"); yield WaitForSeconds(animation.clip.length); animation.Play("fallBackward 1"); yield WaitForSeconds(animation.clip.length); }

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Igotkidsuknow · May 30, 2011 at 04:44 PM

How about testing the animation with just "animation.Play(idle)" in the Start() function?
If that works, then move on to troubleshooting coroutines.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Programmatically import FBX animations as an Animation Component? 0 Answers

Can I make animations snap to a frame? 2 Answers

How to import player model from 4.0 demo project 0 Answers

redo/add animation to character 0 Answers

How to get an animation inside a fbx file to loop? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges