Anim
Many loaded assets contain animations. The Anim
component allows you to play those animations.
Usage
import { Entity } from '@playcanvas/react'
import { Anim, Render } from '@playcanvas/react/components'
const AnimatingDinosaur = (props) => {
const { data } = useAsset('/dinosaur.glb')
return (<Entity {...props}>
<Render type="asset" asset={data} />
<Anim asset={data} clip="Walk" loop />
</Entity>)
}
Last updated on