react-three-editor icon indicating copy to clipboard operation
react-three-editor copied to clipboard

Fix editing in the `ClickAndHover` example

Open krispya opened this issue 3 years ago • 1 comments

This issue is for detailing problems editing in the R3F ClickAndHover example. I am picking this example because it is so basic. I am currently working off: https://github.com/pmndrs/react-three-editor/pull/39

  1. ~~The Box2 is selectable from the scene panel but not by clicking. Inspecting, this appears to be because the ThreeEventManager is using the the presence of __r3f.editable to determine if it is an editable element. However, because the red box is added as a primitive, the intersected Mesh doesn't have __r3f.editable on it.~~
  2. Selecting Box.mesh, moving its position and then saving gives the following error: Uncaught TypeError: Cannot destructure property 'value' of 'input' as it is undefined.
  3. Selecting App.Box2 and attempting to move it produces the error: Uncaught TypeError: Cannot read properties of undefined (reading 'every')

More to come.

krispya avatar Jan 08 '23 20:01 krispya

(1) was fixed with https://github.com/pmndrs/react-three-editor/pull/39/commits/2bd3b34ab8ab74983c7a8d9e0da66a8b2bff1fd3

We will definitely want to use layers now as we are traversing the scene for every hit at the moment.

krispya avatar Jan 08 '23 21:01 krispya