Welcome!

Welcome to our community forums, full of great people, ideas and excitement. Please register if you would like to take part.

This is extra text with a test link..

Register Now

Announcement

Collapse
No announcement yet.

Expression Animations from Maya to Unity

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Expression Animations from Maya to Unity

    I have a turntable with an expression animation in my level. When I export to FBX I include animation but I don't bake it down because I don't want it to end.
    How do I open the level and make the expression animation play in Unity?
    Last edited by drake; October 29, 2014, 09:34.

  • #2
    Not tested yet. I just found this at http://unity3d.com/learn/tutorials/m.../spinning-cube. I'll try it when I get to lab.

    The animation has to be scripted in Unity not Maya. Make sure object is on a dynamic objects layer. In Mesh Renderer check "Use light probes". Click "add component" at bottom of inspector, name, create & add a new script. Double click the script icon to edit it.

    We'll be adding a Public Variable so that speed can be adjusted during playback. Here's the script. Don't forget to save before you close the script dialogue.

    using UnityEngine;
    using System.Collections;

    public class Spin : MonoBehaviour
    {
    public float speed = 10f;


    void Update ()
    {
    transform.Rotate(Vector3.up, speed * Time.deltaTime);
    }
    }

    Save!!! And play. Adjust the speed in the inspector while you play because we made it a public variable.

    Comment


    • #3
      Here's a solution in JavaScript (less picky).

      Code:
      var speed : float = 100;
      
      function Update() 
      {
      	transform.Rotate(Vector3.up * Time.deltaTime * speed, Space.World);
      }
      Assets>Create JavaScript
      Rename script (to whatever you want) in Project window
      Double-click script in Project window
      In MonoDevelop, paste the above code
      Save in Monodevelop
      In Unity, drag script from Project window onto the object you want to rotate
      In Inspector, change Speed variable as desired
      You need to play the game to see the thing spin.

      Comment

      Working...
      X