- Home /
3D Colliders isue
Im trying to do a mobile game where the player need to free rotate a cube to find some images.. The cube has a big collider to detect the OnMouseDrag function and the sprite collider is smaller inside the cube's collider.
how to detect a touch or a mousedown input on the sprite if the cube's collider is in the way?
Answer by Jordash · Oct 26, 2018 at 01:32 AM
A raycast will return on a collison with a any collider matching the layer mask of the raycast. Some options include:
.
A) Having the sprite and cube on different layers and checking for each with a different raycast
.
B) Creating a new raycast in the same direction when the first collision occurs
Im quite a begginer so I have never used raycast, but with some digging I managed to make it work by having the cube and the sprite on different layers, thx alot!
Your answer
Follow this Question
Related Questions
Can I make a hole in a mesh collider? 2 Answers
how to Stop Enemys from clipping into eachother? 0 Answers
3D game: Pickups don't disappear when player touches them. 4 Answers
My 3D collider is not detecting colissions. 1 Answer
Why when i move the player object through the door the ontriggerenter/exit event are not fire ? 2 Answers