Skip to content

Spin

Spin turns an entity around its y axis at a steady rate. A coin or any other collectible uses it for the idle turn it shows while it waits to be picked up.

Its props are in SpinProps.

Client. Spin only changes how the entity looks, and the server has no reason to track a coin’s rotation.

import { Entity, Spin, type EntityProps } from "@daniel-zarinski/engine";
export function SpinningCoin({ position }: Pick<EntityProps, "position">) {
return (
<Entity model="coin" position={position}>
<Spin speed={1} />
</Entity>
);
}