Hello guys,
anyone could help me sync entities like enemys, objects, etc.
This is what is needed : ( for the exemple i will take enemy i think basically it's the same for all other objects )
- On room created --> init enemy with their own position.
- On another actor join room --> update player "view" with current room state number of actual enemy / their position / life / etc ...
- On enemy killed --> Destroy enemy and then respawn after x seconds to it's own spawn point and update it to all current player ...
I know it's not a basic thing i was asking for ^^' ...
So far i've made a pseudo sort of thing for update enemy position ... Something like :
Every x.xx second --> Photon raise event x with *familyEnemy.X&|&*familyEnemy.Y payload to others, target "", group 0 (DoNotCache, forward: No)
Photon on event x --> *familyEnemy set position to (*X pos = (int(tokenat(Photon.EventData,0,"|"))) , (*Y pos = (int(tokenat(Photon.EventData,1,"|"))).
But that seems to doesn't work really well, when there is more than one enemy they was bugged as hell and all try to get the same position ... They also don't keep the enemy skin for each of them in the group *familyEnemy.
I think it's because i don't take each Enemy separetly.
If something was not clear don't hesitate to ask ^^.
Thanks guys =D