Amon
Member
I have code set up to move cubes around a level. There are separate scripts for moving up/down/left/right. The cubes come in pairs and each pair is a different colour.
To move the cubes these scripts take the 'object' argument and using 'with ( object )' the cubes move in the direction pressed: left/right/up/down.
With this method how would I then detect if a red cube collides with a red cube or a yellow cube collides with a blue cube? If two cubes of the same colour collide you get a match but if two cubes of a different colour collide it should fail the level.
Any help would be appreciated. Thanks!
To move the cubes these scripts take the 'object' argument and using 'with ( object )' the cubes move in the direction pressed: left/right/up/down.
With this method how would I then detect if a red cube collides with a red cube or a yellow cube collides with a blue cube? If two cubes of the same colour collide you get a match but if two cubes of a different colour collide it should fail the level.
Any help would be appreciated. Thanks!