️💡
Run npm i sync-ammo
and use <Application usePhysics/>
to enable physics.
The Rigidbody
component enables physics for an Entity
, allowing it to interact with the global physics simulation. You can apply forces, torques, and other physics behaviours to an entity with a Rigidbody
component and it will respond accordingly.
You can learn more about how physics work in PlayCanvas in the Physics docs .
Usage
import { Rigidbody } from '@playcanvas/react/components'
<Entity>
<Rigidbody type="dynamic" mass={12} />
<Render type="box" />
</Entity>
}
Props
The following props are based on the RigidBody Component from PlayCanvas version 2.3.3. This documentation is automatically generated from the TypeScript types of the installed PlayCanvas package.
Last updated on