Slashing gesture?

I want to make a gameplay system similar to fruit ninja, where I can detect if a player “slashes” an object from left to right. I have been browsing the Answers/Forums and I found this. Its great, but I am wondering…how can I detect if the swipe is across an object?
Help would be much appreciated, thanks.

You can simply raycast from the finger into the screen each update and then it’s just standard collision detection with the object from there.

Okay. So I would check to see if the ray is hitting and collider and then check to see if the player is swiping?

Yeah. Somewhere in your game logic you’d check for a touch each update, which in c# will look like: “if(Input.touchCount > 0) {//do stuff here}”.

If that’s true you then access the position of the touch and raycast from that position.