- Home /
Raycast does not detect colliders properly when move object(LineRenderer) with high speed,Raycast does not detect Collider when draw line with fast speed using Input.mousePosition()
Hi, I am working on line drawing game (like Happy Glass and Hello Cat etc) using LineRenderer. I am Using Input.mousePosition() in Update() and draw line. I am using Physics2D.Raycast() to detect Object(Collider) that comes in the path of line and when it detect any object then I stop drawing line. It works fine as long as I draw line with normal speed but when i draw line with high speed, line enters in object and cause late detection of object. I am originating Raycast from the lastPoint( which is the previous mouse position). I think the problem is that when I draw line with low or normal speed then it create many points but when draw line with high speed then it creates few points even sometime only two points because mouse input depends on number of frames. Is there any solution or way that the Input.mousePosition() generates points that are independent of line drawing speed or any idea about procedure used by developers in games like Happy Glass or Hello Cat
Your answer
Follow this Question
Related Questions
Only One LineRenderer Renders 0 Answers
Line Renderer flickering when updated in runtime 2 Answers
How to stop Input.GetKey from cancelling mouse raycasting? 0 Answers
Raycast2D ignores gameobject 0 Answers
Raycasting along line renderer width 1 Answer