tinytree
tinytree

Reputation: 1099

react-three/fiber detect click on empty area

Im wondering how to detect a click on an empty space on my canvas using react-three/fiber. For example to deselect an object. Is there a build in way or do I have to implement a raycaster?

thanks in regard.

Upvotes: 1

Views: 1915

Answers (1)

Oskar Skuteli
Oskar Skuteli

Reputation: 658

Try using onPointerMissed on the <Canvas> element, as documented here: https://docs.pmnd.rs/react-three-fiber/api/events

Upvotes: 2

Related Questions