Spaces:
Running
Running
Update index.html
Browse files- index.html +4 -3
index.html
CHANGED
@@ -130,14 +130,14 @@ document.body.appendChild(vrButton);
|
|
130 |
|
131 |
vrButton.addEventListener("click", createXRExperience);
|
132 |
|
133 |
-
|
134 |
xrHelper.input.onControllerAddedObservable.add(controller => {
|
135 |
controller.onMotionControllerInitObservable.add(motionController => {
|
136 |
const xrRay = motionController.getComponent("xr-standard-trigger");
|
137 |
|
138 |
if (xrRay) {
|
139 |
-
xrRay.onButtonStateChangedObservable.add((
|
140 |
-
if (
|
141 |
const pickResult = scene.pickWithRay(controller.pointerRay);
|
142 |
if (pickResult.hit && pickResult.pickedMesh) {
|
143 |
if (pickResult.pickedMesh.name === "npc1") {
|
@@ -151,6 +151,7 @@ vrButton.addEventListener("click", createXRExperience);
|
|
151 |
});
|
152 |
}
|
153 |
|
|
|
154 |
// Chat System with Transformers.js
|
155 |
async function setupChat() {
|
156 |
try {
|
|
|
130 |
|
131 |
vrButton.addEventListener("click", createXRExperience);
|
132 |
|
133 |
+
function setupControllerInteractions(xrHelper) {
|
134 |
xrHelper.input.onControllerAddedObservable.add(controller => {
|
135 |
controller.onMotionControllerInitObservable.add(motionController => {
|
136 |
const xrRay = motionController.getComponent("xr-standard-trigger");
|
137 |
|
138 |
if (xrRay) {
|
139 |
+
xrRay.onButtonStateChangedObservable.add(() => {
|
140 |
+
if (xrRay.pressed) {
|
141 |
const pickResult = scene.pickWithRay(controller.pointerRay);
|
142 |
if (pickResult.hit && pickResult.pickedMesh) {
|
143 |
if (pickResult.pickedMesh.name === "npc1") {
|
|
|
151 |
});
|
152 |
}
|
153 |
|
154 |
+
|
155 |
// Chat System with Transformers.js
|
156 |
async function setupChat() {
|
157 |
try {
|