- Home /
Is there a way to detect touch without collider?
I have arrows to control the player on the screen and the player has a collider. So if the player jumps it would hit the arrow buttons which would affect the gameplay. I have tried OnMouseDown/Up and Raycast2D but it all requires colliders. Is there anyway to detect touch without collider or make a layer with colliders?
Answer by theLucre · Nov 30, 2014 at 02:00 AM
You can use a layer mask parameter in your ray casting to ignore specific Physics layers. Also, you can configure Physics layers to ignore each other, as in the case of your Player and Arrow buttons in Edit > Project Settings > Physics2D
http://docs.unity3d.com/ScriptReference/LayerMask.html http://docs.unity3d.com/ScriptReference/Physics2D.Raycast.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613172757im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
[Closed]Physics2D.OverlapPoint gets which collider? 1 Answer
Move my character where i touched 2 Answers
Android touch question 0 Answers
Android touch is not dynamic 1 Answer
android touch input 1 Answer