Download

Pausing while using VR

With the default implementation of pause, the update of the camera is also paused. In VR, this is a problem because it prevents you from looking around.

I’ve done a bunch of searching and the only thing I’ve found is this question where a couple of other people mention similar problems.

https://answers.unrealengine.com/questions/56223/how-do-i-setup-a-pause-and-un-pause-using-blueprin.html

Has anyone been able to solve this?

Okay, I’ve made a bit of progress with this, sort of.

What I’ve done is set bShouldPerformFullTickWhenPaused in our player controller to true in C++. This fixes the issue of being able to move the camera around, but it has the side effect of allowing input events to trigger, even when they have “Execute when paused” set to false.

This tells me that I’m probably (maybe?) on the right track. I’d like to avoid having to change any of the Unreal engine code. Any help would be appreciated.

Why not just track your state and check it in the input events?

Because that would involve having to put the same boilerplate code in every single input call in the game. If that’s the only solution, so be it, but this feels like something that should either already be handled by the engine or is a missing feature. This functionality is going to be required by virtually every VR game made in UE4, so it feels weird that it’s not included in the box.

Use a “isPaused” Boolean variable that when the user pauses the game, it disables player input.

Yeah, this is basically the same thing that n008 was saying. It’s definitely a possible solution, and is starting to look like what I’m going to have to do, but it just feels like a hack to patch a hole in the engine.

The other way to fix it is to go in and find where bShouldPerformFullTickWhenPaused is handled, and set it up so that the variable is checked before events are fired too. You could probably submit a pull request for it too if you want it to be default behavior. It might need another bool though, since I can imagine many projects would want the behavior that bShouldPerformFullTickWhenPaused seems to be created for - pausing everything but one actor.

I would suggest having a look at the Showdown demo project… If i remember correctly using the command “pause” from the console works as expected there and leaves headtracking enabled (even positional).

That’s a good suggestion. I’ve checked and you’re right, pausing in the Showdown demo does work. Why it works there and not in our game, though, is still a mystery. I’ll continue investigating.

Take a look at the Disable Input node in the level blueprint. Was looking at doing something similar in fashion, disabling player input but not head tracking. I think this might work, though I will need to do some testing once I actually get my Inputs mapped and a placeholder character put into the scene.

I think I figured it out. It seems that Epic actually fixed this in 4.9, but our engine is still using 4.8. We’re working on the integration right now anyway, so I’ll have a look again once that’s done and post my findings.

I can confirm that this is the case. Pausing now works as expected.