Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my Enter VR button missing or misplaced in A-Frame?

Tags:

aframe

I am using A-Frame, but I cannot see the Enter VR button which is usually on the bottom right corner. Thus I cannot enter VR or fullscreen.

How can I make it show up?

like image 500
ngokevin Avatar asked Aug 23 '16 01:08

ngokevin


2 Answers

If your scene is wrapped in a <div> then you may have to play with the styling your container. <a-scene> is position: relative by default. The canvas and the Enter VR button are position: absolute by default.

This is common if you are using React which requires a render container, or if you are using embedded scenes and putting that in a div.

Try setting the container styles position: absolute; height: 100%; width: 100%;.

like image 104
ngokevin Avatar answered Nov 15 '22 12:11

ngokevin


Using React, I simply told the initial render to use document.body rather than to create a container/div element to hold my AFrameReact components in. This resolved the issue fine for me and the enter VR mode button became visible once again.

Full example: ReactDOM.render(<World />,document.body);

like image 2
Rolley Avatar answered Nov 15 '22 13:11

Rolley