I do want the program doesn’t let me place the building on top of other buildings. My project contains 3 types of 3D buildings with RigidBody and Box Colliders (Is Trigger are checked) that I select from the menu, and a Ground with Box Collider.
I tried to Debug.Log(“Can’t place”) within the if Statement on private void OnTriggerEnter(Collider other) but it get me nothing.
theres not really enough info here, but you should be able to debug this… if canplace is not changing like you expect then well, whatever you are using to cause the trigger, isnt meeting a building…
Keep going! Start printing more stuff… print the tag before you check it… print the name of the thing coming in… print the name of other… it’s up to YOU to figure out what is running and what isn’t running. Find out if the collision event is even being called at all, not just if the tag matches. This is just basic debugging, which I know I have suggested to you before.
By debugging you can find out exactly what your program is doing so you can fix it.
Use the above techniques to get the information you need in order to reason about what the problem is.
Once you understand what the problem is, you may begin to reason about a solution to the problem.
I need to add the CheckPlacement script into the prefabs and figured it out how to adjust the bounding volume of Box Collider component of the prefabs. Editing the bouncing volume is really a challenging one:)