In this game, players control a sphere. This sphere is able to move in any direction, and jump. The problem I’m having is that when I play it as a normal game, the sphere jumps and moves randomly. In Roblox Studio, it works fine, and doesn’t glitch at all. If anyone could help me solve this, or at least figure out what the problem is, it would be greatly appreciated.
EDIT: The output shows an error message that says “exception while signaling: InsertService cannot be used to load assets from the client”, can someone please explain what this is, and how to fix it?
…then you won’t be getting results accurate to the actual game. This is due to the server & client running from the same instance, which changes how things like physics and replication works compared to live servers. You should be using the “start server” testing method instead. This way, you can monitor what’s happening better.
I’ve only used that for testing multiplayer, but I’ll definitely try using it to solve this. Will it be easier to find the problem using this? Right now, I don’t know what’s causing the problem, so I can’t start working on a solution.
It’s not working in-game because your localscript changes aren’t replicating to the server like they are in play solo. Here’s an explanation of what the difference between the client and server are, and what replication is:
If you want it to show up in-game, you have to make the changes from the server. You can allow the client to request changes to be made with RemoteEvents/Functions, but ultimately the server needs to make the change.
The only error that’s shown in the output is this: “exception while signaling: InsertService cannot be used to load assets from the client”
I don’t know what to do to solve this.
The error message tells you how to solve it. InsertService can’t be used on the client – you have to use it on the server (from a Script – not a LocalScript).
The script I’m using is in StarterPlayerScripts, and I don’t see an option to add a normal script. Does this mean that it has to be a LocalScript, or can I put the coding into a normal script and have it somewhere other than StarterPlayerScripts?
You can put the coding into a normal script and have it somewhere outside of StarterPlayerScripts (e.g. ServerScriptService). If you need your server script and local script to communicate, you can use RemoteEvents and RemoteFunctions – here is a tutorial on how to use them.
The script needs to stay in StarterPlayerScripts, and I don’t think it’s possible to change this specific LocalScript to a normal script. I don’t really know how to use RemoteEvents and RemoteFunctions, and I think I would need some help other than the Roblox Wiki to achieve this.