Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change from super-hands to raycaster #204

Open
andreeapav09 opened this issue Jun 19, 2021 · 1 comment
Open

Change from super-hands to raycaster #204

andreeapav09 opened this issue Jun 19, 2021 · 1 comment

Comments

@andreeapav09
Copy link

Hi,

I'm developing a VR application on an Oculus Quest 2 and I'm having trouble coming with a script to change between super-hands controls and ray-caster mode by pressing a button.

What should be a starting point to combine them together?

I'm trying to use both the super-hands and the following in the same scene:

https://github.com/rdub80/aframe-gui
https://github.com/supermedium/aframe-super-keyboard
https://www.npmjs.com/package/aframe-websurfaces

@carlosveny
Copy link

Hello, I know this question is old but I'm developing a game and I've managed to change between super-hands and the controller with raycaster. Basically I use javascript to delete the super-hands entity and I create a new one that has the raycaster. This is an example with the right hand:

// First delete the super-hands entity
document.getElementById("rightHand").remove();

// Then create a new entity with the raycaster
var controller = document.createElement("a-entity");
controller.setAttribute("raycaster", "objects: .raycastable; lineColor: #4103fc; lineOpacity: 1");
controller.setAttribute("laser-controls", "hand: right");
controller.setAttribute("id", "rightHand");  
document.getElementById("rig").appendChild(controller);

Then you can have an event triggered when a button on the quest is pressed that executes that code and you should be good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants