Edit mode (tilde grabbing)
See original GitHub issueEdit mode (tilde
/~
to enable) was working a few weeks ago but now it’s broken; it doesn’t grab objects correctly. When you grab right now, objects will teleport to origin and stay there.
It was previously working like Fortnite, though the matrix inversion was always wrong and caused spatial skipping when clicking the object, which is a bad experience that we can fix.
When you click the object it should stay in place but attach itself to your character. Moving camera should move the object to the new transposed location based on the camera difference. We also have keys like E
(rotate left), R
(rotate right), V
(toggle colliders) which should be respected. to control the grabbed object.
The code for this lives in game.js
but that’s not good abstraction. This control mode should be its own file, communicating with io-manager.js
to get keys and the other managers (like physics) to effect the correct transforms when in edit mode.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
like 50/50, I would move the logic from the game.js to editor-block component [react/UI].
ok, moved all keyhandling to io-manager.