aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.69k stars 3.98k forks source link

The default camera is not deleted #5421

Open Sincenir opened 10 months ago

Sincenir commented 10 months ago

Description:

In SvelteJS. When I add a custom camera, <a-entity crmaera /> or <a-camera /> ,can't delete the default camera. And When I view the Element through "Visual Inspector & Dev Tools" , I find that my custom camera has been activated but is not actually activated. It requires two consecutive clicks through active to activate.

I don't know if ths problem is unique to SvelteJS. I don't see this problem with native HTML.

dmarcos commented 10 months ago

If you can reproduce with vanilla A-Frame I'm happy to look at it but from your description it looks a Svelte integration issue that I don't have experience with. I always recommend sharing code so people can understand what exactly you are doing and can help. https://glitch.com/~aframe is great. Best of luck

Sincenir commented 10 months ago

If you can reproduce with vanilla A-Frame I'm happy to look at it but from your description it looks a Svelte integration issue that I don't have experience with. I always recommend sharing code so people can understand what exactly you are doing and can help. https://glitch.com/~aframe is great. Best of luck

It is indeed a problem with svelte integration.It is currently in my aframe project. I will back and kae a demo. It should be that this problem will occur when using svelte.

DaniruKun commented 10 months ago

I have the same issue with A-Frame 1.5 and SvelteKit

Sincenir commented 10 months ago

I have the same issue with A-Frame 1.5 and SvelteKit

this is a compatibility issues unique to svelte.

I may try to fix the submitted code in the future.

The temporary solution is to manually activate the camera you created through document.query('#camera').setAttr('active', true) before the aframe is rendered.