You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { useFrame } from '@react-three/fiber'
const Respawn = ({ ecctrlRef, setPos, levelPos }) => {
useFrame(() => {
if (ecctrlRef.current) {
try {
const { y } = ecctrlRef.current.translation()
if (y < 0) {
// this random hack ensures position is reset
setPos(levelPos.map(a => a + Math.random() * 0.02 - 0.01))
}
} catch (err) {
console.warn('error in getting ecctrl translation', err)
}
}
})
return null
}
export { Respawn }
And I'm getting this in the console:
Respawn.jsx:13 error in getting ecctrl translation Error: null pointer passed to rust
at I3.wbg.__wbindgen_throw (chunk-GZS6NCTV.js?v=4fa056a0:2477:13)
at 0057ee2e:0x14f24a
at 0057ee2e:0x14f257
at 0057ee2e:0x11b55b
at _AA.rbTranslation (chunk-GZS6NCTV.js?v=4fa056a0:1811:18)
at lA.translation (chunk-GZS6NCTV.js?v=4fa056a0:2650:26)
at Object.current (Respawn.jsx:7:41)
at render$1 (chunk-PEHQA6ZE.js?v=4fa056a0:17451:22)
at loop (chunk-PEHQA6ZE.js?v=4fa056a0:17474:19)
The player does respawn in the level so the code works mostly, but it's strange it's throwing the null pointer error.
Thanks.
The text was updated successfully, but these errors were encountered:
Here's my component:
And I'm getting this in the console:
The player does respawn in the level so the code works mostly, but it's strange it's throwing the null pointer error.
Thanks.
The text was updated successfully, but these errors were encountered: