- Home /
 
Dealing with Mesh parts & Animations
Hi I have a 3d model in blender & its parts are separated each under its own mesh. I am connecting these parts to one part of them as parent. I made animation for these parts using key-frames. I imported these 3d model to unity with the following attributes:
Normals: calculate
Tangents: calculate
Smoothing Angle: 0
Split Animation: marked with the following to sets of animation {(idle,1,33,once,unchecked), (animate,34,63,once,unchecked)}
what I am trying to do is when I click any part of these models is to play the animation for the whole 3d Model & when I click again to go back in reverse to regular state.
I am using the following code to do this
 using UnityEngine;
 using System.Collections;
 
 public class HighlightBehavior : MonoBehaviour {    
     void Start()
     {        
         // Add Animation Behavior to each child
         if (transform.childCount > 0){
             foreach (Transform child in transform){
                 child.gameObject.AddComponent<HighlightBehavior>();
             }
         }
     }
     
     void OnMouseOver(){
         animation.Play("animate");
         
     }
     
     void OnMouseExit(){
     }
     
     void OnMouseDown(){
         
     }
 }
 
               but the resulted behavior is funny. as when I put mouse over a child part it moves to unexpected area or maybe disappear.
Your answer
 
             Follow this Question
Related Questions
Blender to Unity rig : Distend arm 1 Answer
How do i import a blender armature and mesh into unity 3.5? 0 Answers
Importing .blend file - Missing Animation 1 Answer
Importing assets 0 Answers