Question by
justbb · Apr 11, 2020 at 03:11 PM ·
raycastraycasthit
How to make the Ray to be casted only once after every touch?
It's a 3D game. I'm trying to destroy some balls coming from the top of the screen. When touched the ball it shoots a ray and that destroys the ball. The first ball gets destroyed but the other balls that come in the same row are getting destroyed when they come to the place where I previously touched in the game, it's like the RAY is staying there permanently and destroying everything that's coming in its way and when I touch somewhere on the screen again it is gone from there. Is there a way to shoot/ cast a ray only when I touch and stop casting it when I'm not touching it.
Comment
Your answer
Follow this Question
Related Questions
Get component from parent of children hittet with raycast 1 Answer
Foreach working very strange 0 Answers
RayCastHit 2d with layerMask not workin 0 Answers