Gameplay pauses unexpectedly when re-handling values given by the PlayerModule

I have recently submitted a documentation request on the issue, however I have realised that this is likely beyond documentation and is likely a fault that needs to be addressed in the engine. You can see this submission here:

Problem:
When rehandling the movement values given by the PlayerModule under the core scripts (game.StarterPlayerScripts.PlayerModule.ControlModule) you can cause for the engine to unexpectedly enable game.Players.LocalPlayer.GameplayPaused despite the fact the operation should not be causing anywhere near a significant amount of backend lag to warrant the trigger. This is also highlighted by the fact that when the player is moving, the operation can occur. If a player is static however, and the operation is called to occur from an outside script (using a module to allow for the rooting of multiple scripts to handle movement behaviour) the game will pause unexpectedly.

When does this occur?

  • Only when an outside input seems to affect the decision to turn. In the provided example you can see that the outside version actually directly calls the operation. But their seems to be some form of fault whereby Gameplay is paused based on whether or not movement input is being received at the time. If you want to see something really trippy, I’ve included a second version where its always true and when you hold the W key the screen will freak out and break.
  • For reference I have overridden the core modules a bit - however not tons.

Example:

Due to the nature of the project, the source files are not being posted here. They have been sent in private.

Expected behavior

What I expect to happen:

  • GameplayPaused should not enable.
  • The player should instead now tween in the direction the camera is currently facing when the button is either pressed or held.
  • If any errors occur instead, the process should flag said errors - their should be no errors however.
  • GameplayPaused is randomly activating, or the behaviour is not being expressed clearly enough to developers.

A private message is associated with this bug report

After enabling “Render Streamed Regions” to look at the player position it appears to be getting a weird value after the movement is triggered.

Before:
image

After:
image

Can you double check that you are always storing valid CFrame values in any CFrames you are using?

2 Likes

Thanks for this, turns out when the Player is tweened using an invalid CFrame (generated using LookAt, where LookAt is the same as the initial location) an invalid Tween is provided which causes for the GameplayPaused to occur.

Whilst I’m not sure if this is intended, the problem is solved.