I try to write an RTS game. For placing buildings I need to check if they collide with other buildings.
I tried to use: OnTriggerEnter, OnCollisionEnter …with different sets of an GameObject like: isTrigger, isKinematic, RigidBody…
When I had meshCollider and rigidbody the buildings on collision where just jumping from each other, or they just slope down from a hill.
The OnTriggerEnter and other events are checked when Im out of a method and there is one loop in Update(). And they dont return much.
The best way for me would be to have a method that returns true or false on collision. I would like to check it after I place the building too close to other object. Objects are in different sizes and shapes, so I dont know if checking some kind of radius will help.