playMaker

Author Topic: Prefabs won't Play Animation  (Read 2374 times)

destudioanima

  • Playmaker Newbie
  • *
  • Posts: 2
Prefabs won't Play Animation
« on: July 21, 2014, 09:06:45 AM »
Hi Everyone! I'm a newbie to game design, unity, and playmaker and this is my first post.

I'm creating a simple game where a vehicle travels down the road and "reacts" to different obstacles. Swerves away from a post, bumps up and down when rolling over bumps.

I modeled a low poly vehicle in maya and animated it then exported it to fbx. Imported that to Unity. Set up FSMs that call the swerving and bump up and down animation when a trigger is entered.

My problem is that prior to converting to prefabs, the obstacles I set up would properly trigger the animation for my vehicle model.
This is a short video that shows when it works - Not a valid vimeo URL
But when I finally convert them to prefabs and place them back in the scene, everything would seem to work except the Play Animation Action.

I've been trying to troubleshoot this for a week by repeating everything from scratch again and again but still I can't understand why the animation won't play despite there being no error message at all.

Help!

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Prefabs won't Play Animation
« Reply #1 on: July 23, 2014, 11:36:26 AM »
It could be your naming that's biting you in the butt. When you load a prefab into the scene during gameplay it renames the object ( ex Gobject ->Gobject clone). Now if an action was set up to look for the original named object it won't find it. The best way to set up states for pre fabs is to reference itself into a game object variable and then call that variable when looking for animations that belong to it.

destudioanima

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Prefabs won't Play Animation
« Reply #2 on: July 27, 2014, 02:12:45 AM »
Thank you very much Redikann! I will verify all the naming of my game objects, prefabs, and clones.

Much appreciated! :)