how to create colliders for wire (buzz wire game)

how to create colliders for diffferent shapes. i created few box colliders, sphere colliders for the given shape and for the hoop i created mesh collider and make convex and trigger on, the problem is it collides even wire and hoop colliders not touch with each other. i attached screenshot in that if both collider collides that cube became red if not cube became white… is there anyway to create colliders for wire or hoop

General Discussion isn’t for tech questions, but I’ll answer it anyways…

The mesh collider will work,
the problem most likely is because at least one of the two colliding objects must have a Rigidbody.

thanx anyways!! i attached rigidbody to hoop same result

Then it has to be with your code, because a trigger and a rigidbody will do what you said above…

What’s your OnTriggerEnter or OnTriggerStay method look like?

public void OnTriggerEnter(Collider col)
{
//Debug.Log (“eewe”);
if (col.tag == “wire”) {
cubeColor.material.color = new Color (1, 0, 0, 1);
//hoop.transform.position = hoopPosition;
}
else
{
cubeColor.material.color = origi;
}
}
i attached this code, rigidbody to hoop

try col.gameObject.tag instead of col.tag…

If that don’t work, beats me… Only other thing I can think of is to make sure you actually applied the tag to the proper object, and that you didn’t change the collision matrix to ignore certain layers for specific objects.

Are you getting any errors or anything, or is it just not running? Like did that “eewe” debug call when testing?

1 Like