Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

382
Views
TypeError no capturado: no se pueden leer las propiedades de undefined (leyendo 'reproducir'). No puedo hacer clic en mi objeto 3D

Enfrentó un problema al agregar action.play

Estimados desarrolladores, ¿podrían ayudarme a resolver este problema?

Quiero que se pueda hacer clic en mi objeto 3d para que cuando haga clic en el objeto salte. Pero desafortunadamente, veo este error. Sin embargo, cuando observé ejemplos de otros proyectos donde se implementa esta función de clic, no veo ninguna diferencia entre esos proyectos y mi código.

aquí debajo adjunto mi código (Squirrel.js):

 import React, { useRef, useState, useEffect } from 'react' import { useGLTF} from '@react-three/drei/useGLTF'; import {useAnimations} from "@react-three/drei/useAnimations"; export default function Model(props) { const [UpDown, setUpDown] = useState(false); const group = useRef() const { nodes, materials, animations } = useGLTF('/squirrel.glb') const { actions } = useAnimations(animations, group); console.log(actions); useEffect(() => { if (UpDown) { actions.UpDown.stop(); } else { actions.UpDown.play(); } }); return ( <group ref={group} {...props} dispose={null}> <mesh onClick={() => setUpDown(!UpDown)} geometry={nodes.Plane155.geometry} material={materials['Material.010']} position={[-10,32,25]} name = "Squirrel" /> </group> ) } useGLTF.preload('/squirrel.glb')
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!