import { Canvas } from '@react-three/fiber' import { Physics, RigidBody, HeightfieldCollider } from '@react-three/rapier' export default function App() { return ( <Canvas> <ambientLight intensity={0.5} /> <Physics> <TestHeightfield /> <RigidBody> <mesh position={[0, 2, 0]}> <boxGeometry args={[1, 1, 1]} /> <meshStandardMaterial color="orange" /> </mesh> </RigidBody> </Physics> </Canvas> ) } function TestHeightfield() { // 2x2 grid => you need exactly 4 height values const heights = [0, 1, 1, 0]; return ( <RigidBody type="fixed"> <HeightfieldCollider args={[2, 2, heights, { x: 1, y: 1, z: 1 }]} /> </RigidBody> ); } <img width="1077" alt="Image" src="https://github.com/user-attachments/assets/34c96595-040c-4d6c-a801-ddf62b6671db" />