Jump to content
  • 0
Maaco

Change map trigger in VR

Question

Hi,

 

The TriggerChangeMap doesn't seem to work with the VRPlayer script. How can I continue to a new map in VR?

Thanks,

Maaco

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 0

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.

Share this post


Link to post
  • 0

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. 

Share this post


Link to post
  • 0
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

Share this post


Link to post
  • 0

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. 

Share this post


Link to post
  • 0

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?

Share this post


Link to post
  • 0

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   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.

×
×
  • Create New...