Hi,
I have been using a lot of FBX animations in my 2D game and will for some reason the Animator gives a of trouble to flow from one state to the next (its works perfect with sprite based animations). So I decided to use a different method… where I simply Activate and Deactivate FBX animations using the “Activate Game Object” when I go from state to state. It works fine but I wanted to know if there is any disadvantage to using this method (I know its a bit caveman-ish)…
Also I wanted to know if an object is deactivated in a scene … does it use any resources … i.e. If i have to many deactivated game objects in a scene will it slow down my game… or will it only begin to tax the CPU when it activated…?
Thanks guys…
I don’t quite understand how you’re triggering animations by activating game objects.
But have you considered just throwing all the animations into an Animator, with no transitions defined at all, and then invoking them directly via the Play method? (This is approach 2, “code-driven animator” in my animation methods article. That’s 2D, but the same thing works fine in 3D.)
1 Like
Probably no. I do not know but you can make a test. Probably depends on how many. But make a test.
Make an empty game object, and rename it “TEST 01”. Pick an example Game Object and press “D” key to duplicated. Enable it. Drag and drop this copy to TEST 01 Game Object. Select the child copy and duplicate it a lot of times. Then pick up “TEST 01” (collapse it) and duplicated TEST 02 , TEST 03, etc… Now you have a lot of Game object. Make an empty game object, and rename it “TEST FPS” for example. Now you can enable and disable the master parent TEST FPS. Make a prefab of it if you need it. You can also make a prefab of the child as well to look performance of game objects and scripts that are attached to it. You can recycle this prefab in the future. Now you can make the test. You can duplicate your scene one with the Prefab disable and one without prefab. Look and use the profiler memory. Look also Frames Per Seconds (FPS).
Remember that you can call prefabs via scripts so that are not in the scene. Is a general rule not to pay much attention to performance detail when you are starting your first game. Better to fix bugs first, make your game and only when you want to release your game you make performance optimisation. Because when you finish your game sometimes performance change. Look the profiler to debug what is more important and optimise that first.
Alanattano,
Thanks. I’ll take your advice. JoeStrout, I would use the Animator but for some reason FBX doesn’t work good in the animator when it comes to FBX files… I bought Moho 12 Pro (Anime Studio 12) and used that to create my FBX files… sorry to say Moho 12 was a very poor choice when it comes to FBX creation… So thats why I cannot use the Animator with FBX files… But thnaks guys for all the advice… I do have one more question -
Google Play allows around 50 to 100 MB for the APK file when it comes to putting your you game on Google Play… I have such a simple game a simple quiz game and my game size is very close to 100 MB already… and I have reduced my PNG files using TINYPNG… I am just asking but after you compile your game (well build your game using UNITY) do people usually compress the game to make it even smaller?
I saw so many cool games on the google play store with such good graphics and when I look at the file size its only like 70 MB… how do people get the file size so small… I mean what am i missing here?
That disk space is almost entirely resources (textures and sounds). So, yeah, look at your sizes and compression options on those. If it’s a simple game I’m sure you can cut those down quite a lot (unless you need a different image for every question or some such).