Tresjs / tres

Declarative ThreeJS using Vue Components
https://tresjs.org
MIT License
1.91k stars 85 forks source link

The click event does not work on GLTFModel #667

Closed jackywongmm closed 2 months ago

jackywongmm commented 2 months ago

Describe the bug

`

` Am I using it the wrong way?

Reproduction

null

Steps to reproduce

No response

System Info

No response

Used Package Manager

npm

Code of Conduct

jackywongmm commented 2 months ago

<Suspense> <GLTFModel @click="(e, r) => console.log(e, r)" path="/model/K1.glb" draco /> </Suspense>

I missed a label. That's the whole

jackywongmm commented 2 months ago

and <primitive @click="(e) => console.log(e)" :object="K2"> </primitive>

garrlker commented 2 months ago

You're not using it the wrong way, currently event listeners on primitives do not work in Tres.

We recently went through a event system rewrite for Tres v4 that fixes that and many issues like it.

Can you try installing the latest@tres/core release candidate and checking if events work for you?

npm i @tresjs/core@4.0.0-rc.0

jackywongmm commented 2 months ago

Problem solved. Thanks!

garrlker commented 2 months ago

Glad to hear it!