Skip to content

Not able to work with Height Field collider #730

Open
@ApilKakkar

Description

@ApilKakkar

import { Canvas } from '@react-three/fiber'
import { Physics, RigidBody, HeightfieldCollider } from '@react-three/rapier'

export default function App() {
return (





<mesh position={[0, 2, 0]}>
<boxGeometry args={[1, 1, 1]} />





)
}

function TestHeightfield() {
// 2x2 grid => you need exactly 4 height values
const heights = [0, 1, 1, 0];

return (

<HeightfieldCollider
args={[2, 2, heights, { x: 1, y: 1, z: 1 }]}
/>

);
}

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions