- Home /
This question was
closed Apr 27, 2021 at 09:32 AM by
designerpro11 for the following reason:
The question is answered, right answer was accepted
Question by
designerpro11 · Apr 05, 2020 at 01:32 PM ·
unity 5triggerboxcolliderpuzzle
how to detect that 3 cube in the box are from the same tag
I use 3 empty box, i want to make puzzle game Drag cube to match colors
3 Blue = Blue 3 Red = Red 3 Green = Green
The cube fit to any box no problem, just each box must have only a color from one type to win .
I have been working on it 3 weeks and nothing work
Comment
Best Answer
Answer by zyppi1 · Apr 05, 2020 at 04:53 PM
if you use Box Collider on boxes ,then you can use this in box script.
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == ("your cube")) // checking if cube has tag you want { // what should happen }