The sphere that the player controls in this game is supposed to move when a player forces it to, and it does that it Roblox Studio. Whenever I play the game after publishing it, the sphere randomly jumps and moves in different directions, instead of the direction it’s supposed to go in. AutoJump is disabled, so it doesn’t have anything to do with that.
Seen somthing like this issue before. Example: I did a script that did hide the leaderboard ingame, did work perfectly in studio. Didn’t work in game. (I fixed the issue)
Alright, I’ll try changing this to a local script. It’s probably a different solution to what you did since the problems aren’t really related, but it might resolve it.
Be sure you’re handling it from a LocalScript, and make sure you’re properly waiting for all necessary events to occur. Use print statements to try and find any oddities in the code.