- Home /
CharacterController.Move becomes really slow after I move seperate colliders
My game generates roads by randomly placing large pieces of road geometry (with a static collider attached) on the ground as the player drives through the world. The roads it places all exist and the only thing that happens is their position is updated.
Everytime the position is set on one of these charactercontroller.move has a VERY slow call right afterwards, it takes up something like 70% of the CPU while normally it's taking ~10%
Any ideas how I can improve performance here?
Also, let us know if the roads are box, or mesh colliders, convex or not, etc.. A screenshot would be a huge help as well :)
Code is hard to show, it's basically a character controller moving every update and a mesh collider having a position set on it every few $$anonymous$$utes.
The issue I think has to do with the movement of the large mesh collider road...
Showing code is very easy. Click the "101010" button, paste your code.
Since you don't want to post your code or any screenshots, or anything to help us see what you're seeing... The only thing I can suggest is either adding primitive colliders to your roads, or modeling a simpler mesh in whatever 3D modeling program you choose, e.g. a lower poly version of each chunk that will be the collider and disable its mesh renderer.
Answer by Jessy · May 23, 2013 at 03:51 PM
If you are directly manipulating the Transform component of your object but still want physics, attach a Rigidbody and make it Kinematic.
http://docs.unity3d.com/Documentation/Components/class-Rigidbody.html
I don't see how that conclusion makes sense. Regardless, if you move static colliders, you're SOL; everything is going to come to a crashing halt.
Your answer
Follow this Question
Related Questions
Guidelines for using rigidbody, collider, CharacterControllerScript, etc? 3 Answers
Movement script breaks colliders 1 Answer
How to detect angles of walls? 1 Answer
How to deal the 2d platform physics? 0 Answers
What is Happening here? please help. 0 Answers