Hey,
I got unity 3 days ago sorry if this is a dumb question but I am trying to do this for a whole day now.
I made a game using MMD models. But I am getting performance issues. When I run the game inside the editors hierarchy tap a script called MMD4MecanimBulletPhysics appears. Using the profiler I figured out when I remove this while running the game my fps are fine and there is no big quality different to see. But since I am only able to see it when I am running the game removing it wont help because after restarting it comes back. I tried blanking MMD4MecanimBulletPhysics.cs but that gives me an error when I want to run the game.
I also tried this http://unity3d.com/learn/tutorials/modules/beginner/scripting/enabling-disabling-components but it didn’t really help since I can only get into the inspector tap of it while running the game and changes while running the games are reseted.
The How am I able to automatically remove it after starting the game or prevent it from starting from the begin with?
Sorry, I only just started with the code stuff. I can’t figure out how to get the actual name. I tried it like this but it gives the an error
var myComponent = MMD4MecanimBulletPhysics.GetComponent<MMD4MecanimBulletPhysics>();
Destroy(myComponent);
Assets/physics off.cs(13,60): error CS0120: An object reference is required to access non-static member UnityEngine.Component.GetComponent(System.Type)' Assets/physics off.cs(14,17): error CS1502: The best overloaded method match for UnityEngine.Object.Destroy(UnityEngine.Object)’ has some invalid arguments
Assets/physics off.cs(14,17): error CS1503: Argument #1' cannot convert object’ expression to type `UnityEngine.Object’
There is, but if I disable it all other functions like face expression are disabled you cant just choose to disable the physics.
I was over asked at the parts with private and public I just started learning programming… or is this not even the right way at all? Please tell me of you need more information.
Here the top of the MMD4MecanimModel script maybe it helps :
No sadly it is not showing up as prefab not even after starting the game. The only place where I can find it is in the hierarchy tab and only when the game is running and when I delete it there I am fine until I restart the game. When I check in the profiler to see where I lose my performance it is called MMD4MecanimBulletPhysics.LastUpdate() (almost 50% performance usage) and when I click on it it links me right to the object MMD4MecanimBulletPhysics that appears in the hierarchy tab.
Thank you for the offer! I really appreciate all the help from you guys.
I just figured out a way that works for me. In my Project view under plugins\x86 I found a MMD4MecanimBulletPhysics .dll I just deleted this dll. When I strart the game It gives me an error that the dll wasn’t found but the MMD4MecanimBulletPhysics is not showing up in the hierarchy tab anymore and my performance is fine now!