Hi
I am by no means an expert at this, but if i was you, I would create an invisible game object at the green and blue area, and then make each of them a hitbox that covers the area where you want to trigger an event
then on the red cylinder that you are rotating, add a raycast to the front of it, and if it hits an object, make it store the name of that object in a variable - then use that variable to run a compare between the name of the object the ray hit, and the name of the actual box. If the names are the same, fire off an event.
Hope this helps
-Kozgal