Not detecting trace quick mouse movements

Hello everyone !

I’m trying to make a clone of fruit ninja for practice but had a hard time finding resources linked to mouse events and mouse movements

I use the get hit result under cursor by channel

It works pretty well except when I move the mouse very quickly (like you would do in the reel Fruit ninja

So it’s frustrating it looks like it doesn’t detect when mouse is moving too fast

I don’t know if there is a way around it

1 Like

This method may not be enough even if the end user is running it at 240Hz. Those delicious looking things are 3d meshes, right?


Consider the following:

Instead of tracing from camera to mouse cursor, every frame we trace on a virtual plane ahead of us:

  • Start - from where the projected cursor was last frame (Previous)
  • End - to where the projected cursor is this frame

The (here hardcoded) Plane Origin should be the world location where you expect the fruit to pop up - you surely know where they spawn.


When visualised, this will look almost like a continues line at sufficiently high fps:

If we slow this down to 5 fps, we can better see what is going on:

You should still be able to detect anything hit along a line generated every frame.


And one more thing, if the game mechanics allows for slicing more than 1 fruit with a single slash, use Multiline Trace instead, the fruit should be using overlapping trace response for this to work.

3 Likes

I’m having the same problem.
At slow speed I can draw a perfect line. But when I try to draw / cast with fast movements, I have huge gaps between the traces. (Photos attached)

I was trying to use your solution but I couldn’t figure out how.

Can you help me?

Thanks in advance.

Trying to hit