I’ve been working on a construction system for my game but I’ve been unable to find a way to check for an intersection between two objects that returns the collided objects as opposed to a Boolean. Can someone point me in the right direction? Thanks for your time!
You are checking two objects for a collision, without knowing what the two objects are?
I know what the first object is, it’s always going to be the building template but the other collider could be almost anything, an enemy, another building or a terrain feature I’ve deemed unbuildable.
your ‘collision’ object has the gameObject of the other object.
You could use collision.gameObject.tag to decide how to handle certain collisions with a switch statement.
OverlapSphere may also serve you.
Sorry for me delayed response, I was trying out your suggestions here. It seems to be working well enough now, thanks for your time Goblox and Bigmisterb. OnCollisionStay was exactly what I needed.