- Home /
GUITexture
Hi; I'm trying to detect collision between two GUITextures in a scene. How can I do this. I tried different things like using collision box, using Testhit() function, but they could not detect each other. Is there anyway to detect collision?
Thanks in advanced fr your help :)
Answer by robertbu · Jan 19, 2013 at 06:37 AM
I don't know of a way you can directly handle GUITexture collisions. You could shadow the GUITextures with colliders positioned and sized using a mathematical plane and raycasting in world space. If you want this solition I can post a few more ideas.
But detecting collisions of GUITextures is just testing for rectangle intersections, or testing if circles intersect depending on your needs. If you want to use GUITextures, writing your own detection code is likely the way to go.
thanks for your reply. What I have in my $$anonymous$$d to add two cube and enable their mesh renderer, and then make my guitextures as their children, and then detect collision between these two cube. Do you think it works?
I tried it before I posted my answer. It did not work for me.