- Home /
flash animation scene to unity
a few questions i want to ask regarding about animations from Adobe Flash and Unity itself..
how could i import an animation scene from Adobe Flash to unity??
what is the suitable amount of animation time is allowed to Unity for optimum performance??
regarding to (2).. im planning to make cut scenes for every level that is passed.. for your (readers) opinion.. how long does the cut scene to be played??
that is all.. any opinions, answers and suggestions is highly appreciated...
thank you..
p/s : its a stick figure(2D) cut scene..
Answer by J Lam · Jul 17, 2012 at 06:53 AM
Yes, Movie Texture is for PRO only.
or you can have a simple script to replace the texture by frames, here you go, save this into a file SequenceImagePlayer.cs
How to use:
Attach this script to a gameObject with renderer.
You can drag the textures one by one to inspector, or
Place your images under a folder "Resources/yourOwnFolderHere", then input the imagePrefix as "yourOwnFolderHere"
Adjust your frame rate like in Flash
using UnityEngine; using System.Collections;
public class SequenceImagePlayer : MonoBehaviour { public Material playerMaterial; public Texture[] playerImages; public string imagePrefix; public int frameRate = 12;
private float timer; private int currentFrame = 0;
public void Start(){ if (playerMaterial.Equals(null)){ playerMaterial = gameObject.renderer.material; }
if (playerImages.Length == 0){ Object[] allImages = Resources.LoadAll(imagePrefix); playerImages = new Texture[allImages.Length]; for (int i=0; i
public void Update(){ timer += Time.deltaTime; if (timer > 1f/frameRate){ timer = 0f; currentFrame ++; currentFrame = currentFrame % playerImages.Length; SetFrame(currentFrame); } }
public void SetFrame(int currentFrame){ playerMaterial.mainTexture = playerImages[currentFrame]; } }
Answer by J Lam · Jul 16, 2012 at 03:27 PM
You can try export flash animation into sequence images, and load the images as texture to a mesh plane for a quick solve. But this is not a good solution as the texture takes up many memory especially in mobile devices.
If your animations are mainly transform tween animations instead of shape blending, you could try export raw shapes to images and import to unity as mesh plane texture, then animate the plane transform inside Unity. But Unity does not provide a very good editor for keyframe animation, therefore you may feel painful to do keyframe animation inside Unity.
We have similar situation before and we tried many ways around this. And our last approach is "model" in Flash, import and animate in Maya (or any 3D software), then export as FBX and import into Unity. This is the best solution we found to have least impact to memory.
I'm not quite sure whats the meaning of animation time you mentioned...
im new at this animation stuff.. in fact i got an idea of adding cut-scenes to my game... its like a short movie before continuing the game..
what i meant for animation time was the animation period.. or a timeline for the animation... im not so sure whats the correct term for this..
is there another way where i can animate from flash and import directly to unity??
im not doing 3D animations... its a 2D cutscene.. like some stick figures animation...
and.. thanks for your opinion.. i'll try to follow what you have suggested.. that is.. if i can do it...
thanks again..
If its a short movie, you can try looking into the $$anonymous$$ovie Texture that Unity provided, but it is only available in Pro license: http://docs.unity3d.com/Documentation/$$anonymous$$anual/VideoFiles.html
I guess I know what you're asking... Unity is not a frame based editor(tho within update of a $$anonymous$$onoBehaviour, it is being called by "frames"), at least you cannot edit your stuff in a timeslider like the one in flash.
just to confirm.. $$anonymous$$ovie Texture is only available for PRO only..
but the scenes can be imported to unity(without pro license)??