playMaker

Author Topic: How to make GUITexture detect collision?  (Read 3356 times)

warwind10

  • Playmaker Newbie
  • *
  • Posts: 1
How to make GUITexture detect collision?
« on: December 08, 2011, 01:04:35 AM »
I want to make a GUITexture that would detect collision with another GUITexture. I've been trying since yesterday but with no luck :( can someone help me?

MABManZ

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 125
    • MABManZ.com
Re: How to make GUITexture detect collision?
« Reply #1 on: December 10, 2011, 03:31:12 PM »
a texture cannot collide with something...only a collider. Create collider components for each object and use the collider volumes to detect collision.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: How to make GUITexture detect collision?
« Reply #2 on: December 10, 2011, 11:32:29 PM »
Colliders are the way to go. You could try to detect overlapping rectangles but it would probably not be as robust as Unity's built-in collision system.

If you decide to build your own, I'd recommend writing a couple of simple actions: GetGUIElementRect and RectsOverlap. These do seem generally useful, so I'll add them to the next update...