Okay so, I forked a project that uses glitch to send and receive messages, I wanted to either use the code or see how it worked and update my own for player health and server siding more things like a scoreboard, but the link from the code won’t load a project. the link: https://playcanvas-mp.glitch.me/
var Network = pc.createScript('network');
Network.attributes.add('gamePlayManagerEntity', {type: 'entity'});
// static variables
Network.id = null;
Network.socket = null;
// initialize code called once per entity
Network.prototype.initialize = function() {
// this.player = this.app.root.findByName('Player');
// this.other = this.app.root.findByName('Other');
this.player = this.gamePlayManagerEntity.script.gamePlayManagerScript.playerEntity;
this.other = this.gamePlayManagerEntity.script.gamePlayManagerScript.otherEntity;
// var socket = io.connect('https://playcanvas-multiplayer.glitch.me'); // Glitch hosted server
var socket = io.connect('https://playcanvas-mp.glitch.me'); // Glitch hosted server
Network.socket = socket;
// socket.emit ('initialize');
var nicknameVal = this.player.findByName('playerNickText').element.text;
socket.emit ('initialize',{nicknameVal: nicknameVal});
// this.displaySendMsg();