- Home /
Problem with RaycastHit collision
Hi guys!
I'm having this problem in developing slicing game, just think Fruit Ninja. The problem now is when I slice multiple objects, objects behind another object sometimes are not slashed. I'm basically using Orthographic camera and I maintain the layering of the objects by increasing the Z position whenever they are instantiated.
So my guess is that the Ray doesn't hit the objects behind another object so when I slash multiple objects, some objects are not sliced. Since I'm putting the textures on "Cube" and I apply Rigidbody to the "Cube", I need to prevent them from colliding with each others, so I increase the Z far enough to prevent them from colliding. Is there any solution or alternative for this problem? Thanks in advance =)
Are you using RaycastAll? http://unity3d.com/support/documentation/ScriptReference/Physics.RaycastAll.html
If not you should see if this does what you want.
Oh, tried to work it out with RaycastAll and it works. Thanks a lot! =)
Your answer
Follow this Question
Related Questions
iPhone touch raycasting 1 Answer
How to check if raycast is hitting object's child's collision box? 3 Answers
How do I use RayCast in a 2D Platformer game? 1 Answer
Falling object touch 0 Answers
Having trouble with collision system 1 Answer