satansdeer / minecraft-react

A simple blocky game implementation using React and ThreeJS
https://www.youtube.com/watch?v=Lc2JvBXMesY
MIT License
490 stars 44 forks source link

Are there any plans to update this project to the latest version of @react-three/fiber? #24

Open WilldelaVega777 opened 3 years ago

WilldelaVega777 commented 3 years ago

The app doesn't work anymore with the latest versions of the library, some things don't apply anymore like the setDefaultCamera() function not being anymore part of useThree().

It would be awesome to see an updated version of this video and having a chance to learn how to make this app work with the latest versions of the libraries.

I tried by adding:

useEffect(() => {
    set({camera: cameraRef.current})
})

in Camera.js instead of using setDefaultCamera() at no avail. Right now the sphere falls into the floor where the camera object is. It is possible to use the mouse pointer to see around but the keyboard doesn't respond other than to jumps and then I can see a ball around the camera jumping forever on top of it.

It would be awesome to have this example working as I have not found a better video/example of react three fiber with useCannon in the whole web.

metinozkan commented 3 years ago

Did you find the solution? I have same issue and i can't find the solution about this.

marcel-labela commented 2 years ago

Anyone find a solution for this?

tommymaher15 commented 2 years ago

for me the camera works fine, but I keyboard input doesn't work. Going to keep digging and see if I can fix it and will submit a PR if this happens

ldhandley commented 2 years ago

For me the camera and keyboard controls for player movement didn't work. In Player.js, if you swap camera.position.copy(ref.current.position); for ref.current.getWorldPosition(camera.position), the player controls start working again.

ogbabydiesal commented 1 year ago

@ldhandley thanks so much for that, that worked perfectly for me. spent hours checking and rechecking scripts, learned a valuable lesson today, check the repo issues before spending too much time debugging stuff if all looks correct!