I am trying to be able to place boards down when they collide with other objects and you click. However if it collides with more than one object it places more than one board in the same spot. How can I change it so that it only places one board? This is the script on the plank that you use to decide where to place it.
void OnCollisionStay(Collision collisionInfo){
if (Input.GetMouseButtonDown(0) && placeone == false){
Instantiate(woodPlank, transform.position,transform.rotation);
placeone = true;
}
if (Input.GetMouseButtonUp(0)){
placeone = false;
}
}
shouldn’t that do it? Thanks for any help!