@Alexis_Shaju Yes I can do my best. So for reference the player.js is attached to your player only. It’s main function in life is to transmit information about your local player to the rest of the players in the game room.
As you move your local player the postUpdate reads your position and then calls it raiseEvent function which in turn stuffs the structure called data with important information about you and then it runs Photon SDK raiseEvent passing data. Keep in mind when you joined the room the SDK assigned you a actorNr.
Next game-room.js main function is to instantiate other players in the room which are just representations or clones in the room. So look to this function in game-room.js
GameRoom.prototype.updatePlayerPosition = function (content, actorNr) {
const { x, y, z } = content.position;
const pName = content.player.name;
const player = this.entity.findByName(actorNr);
// Display Actor
this.playerName = player.findByName('State').element;
this.playerName.text = pName;
// Set the position
player.setPosition(x, y, z);
};
So this function is called every time one of the remote players changes their position. In your view this is a clone of them. So in the message received you will see content and actorNr. actorNr is the player number that sent the message. content is actually the data sent. So what happens is that the position in this case will update the clone in your local screen based on what was sent by the actual other player or players.
I am working on a better example to post currently but, you can see that I have added a data member to the structure which will contain player info. Under the tag I have created a data member called name. So every time my local player updates it passes the player name entered when joining the room. So it passes data.
const pName = content.player.name;
In game-room.js I create a variable to hold the player name. And then I use it to display over the other players heads so I can see there names in my local players view.
I don’t know how you are activating your animation states but your could pass a state number.
player.js
const data = {
position: {
x: this.tmpVec.x,
y: this.tmpVec.y,
z: this.tmpVec.z,
},
player: {
name: this.app.loadBalancing.myActor().name,
animState: this.<<<<<<<<<<<<<<<<current animation state
}
game-room.js
const pName = content.player.name;
const player = this.entity.findByName(actorNr);
const playerAnim = content.player.animState;
player.set<<<<<<<<<<<<<<<<activavate state playerAnim
Again I did not have a deep look at you animation activations. Let me know if this helps.