- Sort Posts
- 10 replies
- Last post
[HELP] Creating multiple object in Unity
[HELP] Creating multiple object in Unity
I don't have it all off the top of my head but if your Model already has an animation according to Unity's specs: http://docs.unity3d.com/Documentation/ScriptReference/Animation.html Then you can insert code in the OnTrackableFound, OnTrackableLost methods in the DefaultTrackableEventHandler (or the custom TrackableEventHandlers in my demo) and in the code below you do something like:
Renderer[] rendererComponents = GetComponentsInChildren<Renderer>(); // Enable rendering: foreach (Renderer component in rendererComponents) { component.enabled = true; //check if the component contains the animation you are targetting and then Play or Pause component.animation.Play(); }
Details on how to use animations: http://docs.unity3d.com/Documentation/ScriptReference/Animation.Play.html
[HELP] Creating multiple object in Unity
wow~ thanks cap10subtext
did you know how to animate the object. such as i have a heart model. then i want it to have pumping animation
[HELP] Creating multiple object in Unity
I put together a demo video on how to do this. You might find it useful. I map 3 different things to 3 different image targets.
[HELP] Creating multiple object in Unity
Ok, then, if you had a chance to look at the Image Targets sample, this is exactly what the sample does (i.e. every different image target has a different 3D object attached; note: they are all teapots, but they are different instances, with different materials; so don't get confused by that; you could in fact put completely different 3D mdoels under each of the Image targets in the sample)
Yes you can import to Unity from 3ds max and this process should retain your animation. See: http://docs.unity3d.com/Documentation/Manual/HOWTO-ImportObjectMax.html
Unity has a good animation editor, but if you are designing in 3DS it's probably best to animate in that environment as well. I advise doing a test that implements a simple animation sequence on your model in 3DS, and to import this to Unity to ensure that it's behaving as expected.