- Home /
Detecting other Objects when placing Object
Hi there,
When placing a new GameObject on the Terrain (during runtime), I only want the user to be able to place the GameObject when there is no other Object of this type. The Objects might be placed right beside each other, but they shall not overlap.
I wonder whether I should really use Physics (colliders) for this. Is there no quicker and better-performing solution for this? RayCast or something?
Answer by Fattie · May 03, 2013 at 11:46 AM
PhysX is staggeringly, amazingly fast.
So yes: you can place an invisible version there, first, to see what you hit.
This is normal procedure.
And for sure, you can also use raycasts if that works for you. Try both as it's a line or two of code to try.
Performance questions are incredibly out of date, wrong. To draw ANYTHING on the scene, to do anything, the modern 3D hardware-softwrae pipeline is performing a staggering amount of calculations every second.
Simply open your profiler and have a look.
Your answer
Follow this Question
Related Questions
Melee-like function? 1 Answer
Raycast hits when missing a collider, misses when hitting a collider? 0 Answers
how to move an object clone to mouse position, i dont understand ? 1 Answer
RaycastAll isn't finding all possible collisions 1 Answer
How Do You Change The Ray Casting Position or Angle? 1 Answer