microsoft / mixed-reality-extension-sdk

The Mixed Reality Extension SDK enables developers to build 3D world extensions for AltspaceVR, using Node.JS.
MIT License
142 stars 61 forks source link

Hello World sample doesn't work #746

Closed silasalves closed 2 years ago

silasalves commented 2 years ago

I am trying the Hello World sample and I am getting a strange error (similar to #690).

When I first add the Hello World app to the virtual room, everything works fine. After I exit the room and enter again, I get this error on the console:

Behaviors will not function on Unity host apps without adding a collider to this actor first. Recommend adding a primitive collider to this actor.

and the behaviors stop working (i.e. mouse hover and click).

The only way to get it working again is by either removing the app and adding it again, or by changing the Session ID, but it will stop working again after exiting and entering the room again.

What can I do to get the behaviors working without changing the session ID?


Edit 1: I checked that the collider property of the actor was undefined, so I tried to create it with:

if(this.cube.collider == undefined)
    this.cube.setCollider(MRE.ColliderType.Auto, false)

The error message about the missing collider stopped showing up, but the problem persists and it works only once.

silasalves commented 2 years ago

It seems to me that the problem is related to the IP address. I was using my local IP for testing. Once I exposed it using ngrok, the errors disappeared.