I have this in one file…
const [amount, setAmount] = useState(1);
{Array.from({ length: amount }).map((_, index) => (
<Table_A_Individual
position={[index * 30, 0, index * 30]}
key={index} />
))}
And inside Table_A_Individual I’m doing…
const bindHead1 = useDrag(({ delta: [deltaX, deltaY], direction: [dx, dy], }) => {
if (dy < 0)
constrainBaseToHeadUp(-deltaY, nodes.table_A_Base.geometry)
} else if (dy > 0.1) {
constrainBaseToHeadDown(-deltaY, nodes.table_A_Base.geometry)
);
<animated.group {...bindHead1()} {...springHead1}>
<mesh
geometry={nodes.table_A_Base.geometry}
/>
</animated.group>
(Im just showing the relevant parts of the code. It’s been extremely simplified.)
The constrainBaseToHeadUp() and constrainBaseToHeadDown() are where I push points. The problem is pushing points in component also push points in the other components. I was thinking that pushing points in a component would be isolated even though they are using the same model. Here is a screen recording of the issue, here it is live for the adventurous.