- Home /
How to avoid input ray passing into multipe objects ?
Hi all,
here am facing a very big problem while dragging object. Consider am having a cube(Static cube) in game view, and another cube(Movable cube) is in opposite side. i need to drag the movable cube around the screen with drag in iOS. now what problem i'm facing is when i bring to the movable cube on the static cube, the static cube also moving along with the movable cube. i got to know the problem coming because of ray. the rays are passing every where. how to avoid this situation ?
Thanks.
it's very likely that the physics LAYERS system will help you ... check it out.
Answer by Anusha · Sep 04, 2012 at 07:37 AM
tag ur movable cube, on hit check what u have hit n if its ur movable cube apply drag to it.
tags are O$$anonymous$$ but for anything other than the most trivial learning games, you need to learn to use the physics LAYERS system all the time as a matter of course! so, learn tags as well! :)
yeah ....tagging objects is not a big deal...handling layers and layer mask should be the correct solution for that....
Your answer

Follow this Question
Related Questions
How to apply offset to touch position when dragging object 4 Answers
drag object ios 2 Answers
Unity2D iOS Dragable items by touch 0 Answers
Xcode can't open my project 0 Answers
Grab and Drag Terrain to move camera 0 Answers