x


Interacting with nested colliders simultaneously?

Let's say I have a collider B that is nested inside of collider A (as are their gameObjects)

When I onmouseover/enter A, I want gameObject A to move to the left. When I onmouseover/enter B, I want gameObject B to turn green.

I'm not sure how to do this simultaneous mouseover detection if collider A is blocking/masking collider B.

At this point, I essentially have a 2-step detection where the first step destroys the first collider. I want something better. :)

Any tips or pointers appreciated!

more ▼

asked Jun 08 '10 at 01:28 AM

pickledzebra gravatar image

pickledzebra
286 31 35 44

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You need to use raycasts to detect where your mouse is and return all the hits on the ray with raycastall. Then you can fire off however many functions for each collider you have.

more ▼

answered Jun 08 '10 at 02:11 AM

spinaljack gravatar image

spinaljack
9.1k 18 31 91

Thanks so much. I thought it was raycasting, but couldn't find the specific answer.

Jun 08 '10 at 02:37 AM pickledzebra
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x283
x37
x36

asked: Jun 08 '10 at 01:28 AM

Seen: 880 times

Last Updated: Jun 08 '10 at 01:28 AM