- Home /
When I Play..Framerate is 1.5!!!
I'm trying to make a simple driving game, I wrote this code in the update function of the car "gameObject" function Update () { if(Input.GetKey(KeyCode.UpArrow)){ gameObject.transform.Translate(0,0,2); } }
Then I start playing.. I Press to Up Arrow key, and the game is down from more than 60fps to 1.5fps! why ?!
UPDATE!!! This error is caused if I add a Rigidbody Component to my car!.. I Don't want to remove the rigidbody component, so what should I do?!
ANOTHER UPDATE!!!!!!
I Fixed that error, it have nothing to do with my problem!
I Noticed that my Car is having sooo many meshes, I think that's why it lags, so the question now is, how to export this car as a whole From google Sketchup! I mean to make it only one mesh.. not multiples meshes
And this is a screenshot.
I suspect it's the error message in red at the bottom of the window ("Compute mesh inertia tensor failed") that is causing the slow down.
$$anonymous$$ultiple errors will kill your framerate. Fix the error in the console at the bottom left of the screen. Also remove any Debug.Log statements you have running around.
Answer by zugsoft · Sep 25, 2014 at 12:48 PM
Export your Sketchup to 3ds or obj. Import it to Unwrap3d, and export to fbx, by default it's only 1 mesh. You can also reduce polygon count with unwrap3d.
Answer by KMKxJOEY1 · Sep 24, 2014 at 07:53 PM
Regardless of the amount of draw calls your car is, the amount of polygons being rendered will still evoke graphical lag. I suggest you use a less high-poly model; any video game 3D artist knows that being conservative is import (So don't just download models from the Sketchup Warehouse).
Answer by LSPressWorks · Sep 25, 2014 at 04:35 AM
That error seems to appear most often when you have a 2d plane attached to moving rigidBody.
Are you using a plan instead of a cube for the road by any chance?
Your answer
Follow this Question
Related Questions
OnTriggerEnter not functioning 0 Answers
Car Accelerate Over Time. (JavaScript and RigidBody) 2 Answers
Rigidbody, Front slides toward Gravity down Hill 0 Answers
Car not rotating when grounded 0 Answers