FixedUpdateNetwork is not being triggered
Hi everyone. I am new to Photon, I am trying to implement a simple network solution, but for some reason the FixedUpdateNetwork() is not being called at all. Can anyone help me to understand why ?
public class AWNetworkInputController : NetworkBehaviour
{
(...)
public override void FixedUpdateNetwork()
{
//Gets Input from Server
if (GetInput(out AWNetworkInputData networkInputData))
{
move = networkInputData.move;
look = networkInputData.look;
jump = networkInputData.jump;
sprint = networkInputData.sprint;
}
}
(...)
}
Comments
-
Hi,
The
FUN
is not called at all? or only theGetInput
?FixedUpdateNetwork
will be called on every valid Network Object, so you need to make sure the "is valid" field is checked on the inspector, if it's not, then the object is not correctly registered, possibly due to scene loading if it's a scene object. Keep in mind that every NetworkBehaviour needs a valid NetworkObject to work.GetInput
return true on the input authority and on state authority. That means that for a client to return true, it needs to have input authority over the Object.Please go through our Fusion 100 Series: https://doc.photonengine.com/en-us/fusion/current/fusion-100/overview
It will help you get started with Fusion.
-----
Isaac Augusto
Photon Fusion Team
1 -
Hi. Thank your for your comment. I believe I now have found the answer to my question. The Script that has the FixedUpdateNetwork cannot be added dynamically. Otherwise it will not run. These is probably because the event is being added at "game start" (or similar) and not in class instantiation as in my opinion should, to allow more flexible dynamic network object instantiations.
I think the photon fusion's code should be more decouple in terms of startup dependencies. I am finding it very difficult to use photon with dynamic created objects instead of scene objects.
I wonder if it is possible to have a prefab with only a NetworkObject and create anything else dinamically ... for the look of it, it isn't.
0