- Home /
How do I pick up an object and place it in a spot that kind of like a missing puzzle piece?
I'm working on an escape room game and I am able to make a character pick up a puzzle piece using ray cast. What I want to do next is that I want the character to place that puzzle piece where the missing piece slot is and I need help with that. I thought if the two colliders would collide with each other, the puzzle piece disappears and it appears where the missing slot is.
public class OnTriggerObject : MonoBehaviour { [SerializeField] private bool placeTrigger = false;
private void OnTriggerEnter (Collider other)
{
if (other.CompareTag("Touch"))
{
if (placeTrigger)
{
gameObject.SetActive(false);
}
}
}
}
Comment