User action too fast for Update()

I’m working on a game where you draw lines on the screen while the left mouse button is held. One of the objectives is to make sure when you hit anything as you’re drawing, the line drawing ends. I’m using raycasting to detect what I hit, it works fine but if I move the mouse cursor too fast, the line passes through the objects on its way.

This was very confusing, so I decided to track the mouse positions on the console as I drew, I noticed that if I draw the line slowly, all the proper input get’s recorded, if I draw too fast, it does not return all the input, instead, it just skips through most of the positions between the start and end points. I did some research and I found out that if your user input is faster than the Update() function, this would happen, some suggested FixedUpdate() with some tweaking in the project settings, I tried that but still no luck.

Any ideas on how to get around this?

Thank you…

this is normal. the position is tracked each frame. depending on the performance this can be 200 times or only 5 times per second. the only reasonable way of doing this is measuring the distance in between points based on a minimum distance.
what you consider proper input is just a very small stepping, what about in between those points?
what I’m saying is there is an infinite number of positions you miss, it’s just a question of how close you want them.

The lines you draw should perhaps include a ray or a calculation that checks if the line intersects with something and if it does then stop the drawing of the line. You can’t force the Update loop to run at any particular rate. If you could then every game would be running at 1000 fps or more. It has to drop some information to keep up with the current state, but you can compensate by doing some calculations that take the lost information into consideration.