So how exactly do I access GetMoveVector() in the new scripts? Can you list a code snippet please. Thank you.
Itās a consequence of exporting some of these from Studio, just after a bug got introduced that exports scripts (Save as Fileā¦) with \r\r\n (CR CR LF) line endings. I didnāt catch it because my diff program ignored it. I have since corrected this, though depending on the timing of the release, these stretched out versions may be live for a week or so. Functionality is not affected.
Many of these inconsistencies are simply being carried over from the currently-deployed player scripts. The complete reworking of the player scripts is being rolled out in stages, with each stage addressing particular issues while trying to maintain status quo with regard to function. This stage is about restructuring, while trying to touch the underlying code as little a possible, so that any issues which arise are clearly the result of the structural changes and not hundreds of tiny differences introduced by code cleanup. I agree the cleanup is needed, I just want to isolate it from the restructure.
Just to be clear, you should not be forking or putting this pre-release code in your actual live game, it should be used only to evaluate whether or not having the player scripts restructured in this way affects your game. Things like commented out code, debug prints, etc. Iāve already removed from the build that will follow up a week later (a cleanup pass).
Additionally, this refactor is not about āallowing forkingā, the whole point of the restructure is to minimize the need for developers to fork the scripts and forgo updates by letting them require the player scripts modules and call methods on them. Forking will still not be encouraged, apart from the special case of forking the old version while you adapt a game to the new structure.
Is this the correct way to get the move vector in the new scripts?
-- In a local script
local PlayerModule = require(game.StarterPlayer.StarterPlayerScripts:WaitForChild("PlayerModule"))
local ControlModule = PlayerModule:GetControls()
if ControlModule then
local MoveVector = ControlModule:GetMoveVector()
end
There seems to be a change compared to the old player scripts in terms of GetMoveVectorās behavior. When you are just spawning, there is no control module set yet, so the returned control vector is nil. I would recommend returning a default value here (i.e. Vector3.new()) to minimize compatibility issues. @AllYourBlox
@MapleMarvel as such that is not enough, youāll have to add āor Vector3.new()ā behind the call for now, otherwise it might be nil.
@buildthomas @AllYourBlox So is it the ControlModule that can be nil, or is it the GetMoveVector() call that can return nil? And is this every time the character spawns, or just when the player initially joins?
Itās the vector. I havenāt seen the PlayerModule code, but you can check yourself if the module can return nil.
On another note, you want to use the PlayerModule given to the local player, not the one under StarterPlayer. I believe it appears under an object called PlayerScripts in each player.
Spacing code out is quite common and an industry standard, although this is a little far lol.
Sighā¦ so my game is going to break (again) on the 11th because I override MasterControl but no info on how to fix it ahead of time.
What do you mean no info? (Did you read first post fully?) You should just fork the control script until this update goes through, and then update your codebase to work with the new structure whenever you get around to it.
Just a reminder, this is happening today, in case you need to update your game with the legacy scripts.
When will this be live?
It is live now. Itās a server flag, so existing game servers will not be running the new scripts, only new servers that come online.
Looks like requiring the new PlayerModule to use handy functions like :GetMoveVector() creates additional TouchGuis, doubling UI like the jump buttons on phone/tablet and causing weird glitches with the visuals and inputs.
When I comment out the code requiring PlayerModule, it returns to the correct behavior (only one TouchGui).
Hereās a repro.
NewPlayerScriptsTouchGuiCloneBug.rbxl (16.9 KB)
Also, it seems like the camera gets caught on the character when you look from below now.
https://i.imgur.com/VzSLegI.mp4
I have discovered a serious bug in the new camera scripts. I have filed a bug report, and included a repo file.
While adjusting to the new system was not difficult, I canāt STAND the updates to the camera, as they are causing a ton of different issues in game with even basic functions. For example, this used to just watch the player from a given CFrame, but now it does this:
[Seizure Warning?]
https://i.gyazo.com/aa0fc73f2bba2eeae4e94d6d2c5c7465.mp4
Iām working on adapting to this but for now this is highly annoying to fight through. If I am being dumb and thereās a change I need to make that Iām forgetting feel free to call me out on it.
Weāve turned off the new Player Scripts deployment to address the issue with the VehicleController no longer functioning. If youāre already actively working on migrating to the new structure, please be aware that right now these scripts are not deployed and any places with the pre-release scripts (or forked versions of what was live this morning) in them will additionally need a disabled or empty ControlScript or CameraScript in StarterPlayerScripts in order to suppress the automatic addition of the old player scripts in a published place.
Is there any chance you have more than one script trying to control the camera in this place? Itās not immediately obvious to me what else would cause such erratic behavior.
Iām in the process of checking for conflicts. The only thing that comes to mind is if interrupting an interpolation of the camera with another action no longer breaks / overrides it but instead acts in addition to the interpolation, then that might be causing the issue.
I have had this problem too
I have one script that sets the camera to āScriptableā, sets the CFrame of the camera, then uses tweenservice to tween the cframe