Why does react-spring animate when I pass it an array of 3 numbers, but not when passed a Vector3?

26 views Asked by At

I have a goofy semantics question about react spring and r3f. So when I create the spring like this

const { position } = useSpring({
    position: visible ? new Vector3() : props.position,
});

it jumps to the props.position with no lerp or transition stage.

but when I do it like this

const { position } = useSpring({
    position:
      visible ?
        [0, 0, 0]
      : [props.position!.x, props.position!.y, props.position!.z],
});

it smoothly animates between them. Are these not functionally the same things? I am very confused any help would be greatly appreciated.

0

There are 0 answers