Insight into how "Gameplay Paused" operates - especially in context to creating and handling the inputs of players in control module core scripts

Problem:

When I have decided to create my next project, I was unhappy with how the default movement physics operated. As such I wanted to redefine and upgrade the current movement core movement mechanics while still retaining all the camera operations, user movement choices and most importantly the general way you control the characters.

In order to achieve this, I went in and rewrote the back end move functions and essentially hijacked the PlayerModule. What I have found however is that when writing my own module to handle the movement the “GameplayPaused” setting enables in a relatively unprecedented manner.

How have I made it enable?
Apparently, irregardless of how completely seperate the threads are (I’ve used getter and setter methods as well to try and get around this) when you include your own threads into the module you will for unknown reasons get a “Gameplay Paused” error (it is essentially a metamodule - a module that creates the code in virtual space, but is readable during gameplay). Seeming two threads that shouldn’t be able to cause the gameplay to pause can now suddenly cause issues to occur!

Here is an example video:

  1. In the first instance, I press W in order to make the player turn using the standard wasd controls (obviously mixed with my own code as this is not default behaviour).
  2. When you press B, a completely outside piece of code calls the module requesting the player to turn. This will randomly cause a gameplay pause.
  3. The gameplay resets itself, you can now press W to achieve the same behaviour.

Proposed Solutions
Now my issue with this whole code fiasco is either theirs a bug in the engine and this shouldn’t be able to occur, or the documentation about GameplayPaused is insufficient. From my research I cannot see any reason why this behaviour is occuring. I will admit that most people wouldn’t venture into the territory that I’m going into, and my methodology is something quite unique, but a problem is a problem all the same.

My next general plan to hopefully solve this issue is to completely separate the turn physics and make my script read only essentially, it would be nice however if more information was provided on how GameplayPaused operates as it seems to be a security aspect rather then a boundary in the code.

For the sake of not disclosing my code to the world, I am not going to share the exact details publicly here and as such I have included the place file in private here:
https://devforum.roblox.com/t/link-for-documentation-request-possible-bug-report/2520930

6 Likes

I can now confirm, whatever I have done… the engine does not like it.

I have fully separated the code now, even used deep copies to make the read only value completely separate - for some reason an input function will cause it to go “Gameplay Paused” on me.

2 Likes

Disable filtering enabled. I don’t know if it actually works and I’m too lazy to test it so try it.

FilteringEnabled was removed in July of 2018.

1 Like

Does the character seem to be owned by the server? If so, you probably got the nanspeed glitch applied to your character. When in characters, it makes you be owned by the server and trips up streamingenabled. On other objects, they just flash and sometimesmake random things flashing/invisible.

1 Like

Make sure that the characters network ownership is the player, and try disabling StreamingEnabled under Workspace to see what happens.

I meant StreamingEnabled. Sorry.