0

Recently developing a racing game, game is fine but when i added traffic system (AI cars with waypoints follower) the game becomes laggy ans slow. I used almost 300+ more cars with rigidbody and box collider attached. I searched about the solution of the problem : Some said it's the amount of rigidbnody or collider for making the game slow. But if I remove colliders then I won't be able to detect the collision between my main player's car and AI traffic cars.

Any solution or suggestion ?

XpressGeek
  • 2,889
  • 3
  • 23
  • 27
  • Are there 300 cars on the screen at the same time? If not, can you 'cheat' or at least simplify the actions of the cars if the cars are off screen. – Morrison Chang Aug 28 '16 at 04:34
  • Yes the 300 cars on the screen at the same time but not in front of camera view. I mean the cars spreads around the road circuits and moving with a certain speed like normal traffic system. – XpressGeek Aug 28 '16 at 04:43
  • What is the FPS on your PC and the FPS on your mobile device? The problem could be anything but without your code no one can tell what's going on and you can't post all your code here either. What **piece** of code do you use to detect when the car is at the red light? Are you using `Vector3.Distance`? – Programmer Aug 28 '16 at 05:08

0 Answers0