[SOLVED] Multiplayer game script not working

So, when I launch the game the main screen and the chatbox are both enabled when they are not supposed to be. here is the editor. The error appears in the launch. Test it out and please fix this problem.

In your gamePlayManagerScript, you haven’t provided the otherEntity attribute with an entity which is why it’s null and that’s why it’s throwing an error.

1 Like

The error is the main screen cannot be enabled/disabled.

Now this happens when i start the launch

[network.js?id=67904620&branchId=7e5d4afd-15d3-49af-b083-0f872753849e:92]: Uncaught TypeError: Cannot read properties of null (reading ‘element’)

TypeError: Cannot read properties of null (reading ‘element’)
at scriptType.Network.createPlayerEntity (https://launch.playcanvas.com/api/assets/files/scripts/connection/network.js?id=67904620&branchId=7e5d4afd-15d3-49af-b083-0f872753849e:92:46)
at scriptType.Network.initializePlayers (https://launch.playcanvas.com/api/assets/files/scripts/connection/network.js?id=67904620&branchId=7e5d4afd-15d3-49af-b083-0f872753849e:57:44)
at r. (https://launch.playcanvas.com/api/assets/files/scripts/connection/network.js?id=67904620&branchId=7e5d4afd-15d3-49af-b083-0f872753849e:30:14)
at r.emit (https://launch.playcanvas.com/api/assets/files/scripts/connection/socket.js?id=67904596&branchId=7e5d4afd-15d3-49af-b083-0f872753849e:3:12375)
at r.onevent (https://launch.playcanvas.com/api/assets/files/scripts/connection/socket.js?id=67904596&branchId=7e5d4afd-15d3-49af-b083-0f872753849e:4:26293)
at r.onpacket (https://launch.playcanvas.com/api/assets/files/scripts/connection/socket.js?id=67904596&branchId=7e5d4afd-15d3-49af-b083-0f872753849e:4:25915)
at r. (https://launch.playcanvas.com/api/assets/files/scripts/connection/socket.js?id=67904596&branchId=7e5d4afd-15d3-49af-b083-0f872753849e:4:28033)
at r.emit (https://launch.playcanvas.com/api/assets/files/scripts/connection/socket.js?id=67904596&branchId=7e5d4afd-15d3-49af-b083-0f872753849e:3:12375)
at r.ondecoded (https://launch.playcanvas.com/api/assets/files/scripts/connection/socket.js?id=67904596&branchId=7e5d4afd-15d3-49af-b083-0f872753849e:3:18962)
at s. (https://launch.playcanvas.com/api/assets/files/scripts/connection/socket.js?id=67904596&branchId=7e5d4afd-15d3-49af-b083-0f872753849e:4:28033)

Your game was working without any errors right? Please check which changes you made to find out what can cause the errors.

I did the player look at the mouse and that’s when it happened, but I need it fixed.

In which script did you make these changes?

1 Like

Thank you for your help! I accomplished it myself though. But thanks for your help, really!

1 Like