Can't change bool while accessing other script

Hi, I’ve tried several different ways for this… Really need help.

When the Thrombocytes (grey stuff) are in the trigger collider “VesselCollider”, it should set bool “vessel” to true in the other script named “Follow” in the “Thrombocyte” GameObject. See pics.

Thing is it doesn’t. When I change the bool manually to true, it works, so the rest of the scripts is fine. Just trouble triggering or accessing the boolean…


You can try to debug the other.gameObject and check if it is the vesselCol object?

2 Answers

2

I think two trigger colliders do not detect each other. You might have to make one of the triggers (maybe the Thrombocytes one) a collider with an attached rigidbody (maybe set to kinematic) to be able to detect it entering the other trigger.

That will definitely work, thank you. Didn't know two Triggers don't detect, that could be inconvenient if I wanted larger colliders just for that event, because as not triggers they would collide (obviously) with others objects. But it's not the case. I'll test it later!!!

If you want a collider to not collide with other objects, you could create a new layer, and in Edit > Project Settings > Physics, untick all the tickboxes for that layer in the Layer Collision Matrix.

Someone give that man a cookie

i pasted the link of unity documentation you can see more details from the unity panel, this is basic,try to find first at unity documentation about syntax errors, if your problem not solved then ask question.

Thank you Sublime! It works!

192.168.0.1