From 95fea654098e9185d03cdfb04903e216a6e1639d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:14:34 -0500 Subject: [PATCH] fix: invalidate splash animation frames --- .../website/src/components/Armor/components/ShotDisplay.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/website/src/components/Armor/components/ShotDisplay.tsx b/packages/website/src/components/Armor/components/ShotDisplay.tsx index b7047ed74..859b7bc6d 100644 --- a/packages/website/src/components/Armor/components/ShotDisplay.tsx +++ b/packages/website/src/components/Armor/components/ShotDisplay.tsx @@ -1,7 +1,7 @@ import { J_HAT, K_HAT } from '@blitzkit/core'; import { Box, Flex, Text } from '@radix-ui/themes'; import { Html } from '@react-three/drei'; -import { useFrame } from '@react-three/fiber'; +import { invalidate, useFrame } from '@react-three/fiber'; import { clamp } from 'lodash-es'; import { useEffect, useRef, type ComponentProps } from 'react'; import { @@ -104,6 +104,8 @@ export function ShotDisplay() { outTracer.current.scale.set(1, 1 - 2 * Math.abs(tracerT2 - 0.5), 1); outTracer.current.position.set(0, tracerT2 * outLength, 0); } + + invalidate(); } if ( @@ -119,6 +121,8 @@ export function ShotDisplay() { splashRadiusWrapper.current.scale.set(scale, scale, scale); splashRadiusMaterial.current.opacity = opacity; + + invalidate(); } });