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:
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).
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.
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.
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.
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.
I know this is a really old post but perhaps i can shine some insight on the issue, I was working on my own “velocity-based” movement system and i ran into the same issue, after a few test’s i was able to isolate the issue down to a VectorForce value being a ‘nan’ vector, essentialy when input wasn’t detected or perhaps in your case when input is detected some of your vector fields are nan, causeing issues and leading to the gameplay paused. I can’t say i completley understand what’s happening under the hood but following How do I check if a value is NaN? - #2 by Tommybridge The attached post i was able to ensure my vectors were either “value filled” or vector3.zero and this resolved the issue for me.
Hey Shadow, I can confirm that my problem was a result of a fault in CFrame in the end, more specifically the miscalculation of a LookAt operation which led to the problem. I had a discussion with one of the engineers in Roblox, and whilst rare to occur the problem was quite difficult to diagnose as frankly unless strict code was enabled their was no form of warning on this matter.
Yeah, in-fact if you’re not making large open worlds disabling StreamingEnabled is preferred since small maps benefit from having the entire workspace loaded at once on the client. (Atleast in my eyes)