Only the owner can modify: "State";
Options
https://www.youtube.com/watch?v=rBZYKXtThiw&t=612s
At 11:00 you can see the error mesage in orange Only the owner can modify: "health" that is i whan to solve, let enyone mothefaid "health", someone have and a idea?
0
Comments
-
Read through these docs:
https://doc.photonengine.com/en-us/bolt/current/in-depth/entity-ownership/
https://doc.photonengine.com/en-US/bolt/current/reference/glossary/
The simple way to solve this is to use an event sent to the owner of the entity to modify the state.0 -
So that message means only the player that owns (instantiated) the object can modify its state. So in the script, you need to make sure you only modify the 'health' if you are the owner. As an example, you can enclose the health modifying code in an 'if' statement like this:
if(entity.IsOwner)
{
state.Health = localHealth;
state.AddCallback("Health", HealthCallback);
}0