|
Hello everyone, I have a type of weel made by one or more cells that can rotate simultaneously around an object. Each cell has a collider on it and i have created a script placed on the parent object of these cells with OnMouseDrag() event that rotateS the structure. Now, how unity references say, cell's colliders are now handled like a single collider and there is no problem with this. But what i would like to know is wich cell is being hitted or how i can change my structure in order to obtain this result? Tanks in advance!
(comments are locked)
|
|
I have a similar situation where I want to know exactly where on a collider i am hitting and I use the coordinates on the texture that was hit to help determine exactly where on the object it was hit.
Does that help?
(comments are locked)
|
|
you can give a spesific name to each of them and then you can recognize them with their name. if you want to see wich is clicked you should trace a ray from mouse position to see what will be collided. also you can use the GetInstanceID() to get the unique id of the collider and compare it to a pre built list of collider ids. Thanks for the answer Ashkan. I already have assigned unique name to each cell but, i can't hit them singularly becouse my cells are grouped in a gameobject acting like a container that will receive implicitly collision instead of my cells. Maybe i'm asking a stupid question but maybe someone have solved it.
Jan 12 '10 at 03:10 PM
Frenses
put your code here then i can help you. where do you check for the collider? how do you check it?
Jan 12 '10 at 05:40 PM
Ashkan_gc
(comments are locked)
|
