Jump to content

Change map trigger in VR


Maaco
 Share

Recommended Posts

This is an interesting problem because with the VR player, there is no collision, there is just the real player walking around themselves.

So this can be solved by adding a collideable object to the player's headset. I don't have an example of this right now, but it is pretty easy to do. I think I will make this standard in 4.6.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Hi Josh,

Thanks for your answer.

I just did some tests where I had a box dropped  (prop with a mass) onto the ChangeMap Trigger and the weird thing is that it will only load the new map when I have the FPS Player script attached to the player model. Once I use the VR Player script on the player model the map doesn't want to load when the same box is dropped. 

Link to comment
Share on other sites

30 minutes ago, Maaco said:

Hi Josh,

Thanks for your answer.

I just did some tests where I had a box dropped  (prop with a mass) onto the ChangeMap Trigger and the weird thing is that it will only load the new map when I have the FPS Player script attached to the player model. Once I use the VR Player script on the player model the map doesn't want to load when the same box is dropped. 

The vr player has no collision shape or mass

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

The box I used for colliding with the trigger was dropped independently of the player entity (just falling down by gravity) and did have a mass and collision shape. That seems to work while having the FPSplayer in the scene (even when the player is not colliding with the trigger) but not while the VRplayer is being used.

In other words: when this particular box collides with the trigger while looking at it 'through' the FPS player it works, but while looking at it 'through' the VR Player it doesn't. 

Link to comment
Share on other sites

After doing some more testing using an (player independent) object to collide with the ChangeMapTrigger the new map loads without a problem in the normal (FPS Player) setup. In the VR environment the trigger gets activated, but then the game crashes with the following error message: "modeOpenGL error GL_INVALID_OPERATION" As I'm not sure what exact conditions are required (in the next map?) for successfully loading a new map I think it's best for me to just wait for 4.6.

Other collison scripts are working perfectly in VR (e.g. I've made a keycard you can pick up with the (touch)controllers and hold it next to a cardreader to open a door), so I guess this issue is somewhere in the map changing/loading system?

Link to comment
Share on other sites

Well, I seem to be running this topic all by myself answering my own questions, but thats allright:lol:

Anyway, for anyone that cares: I at least solved the trigger collision problem for the VRPlayer script  by simply adding "self.entity:SetParent(camera)" to the UpdateWorld function in the VRPlayer script (as Josh kinda already suggested) So now the player model (with mass and a collison shape) follows wherever the VR camera goes. Only problem with this quick fix is that the player can't use moving platforms or elevators as the camera isn't influenced by them. Loading a new map still doesn't work but triggering other events by player collision at least work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...