The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on Fusion.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

FixedUpdateNetwork is not being triggered

mcregdom
2022-10-29 15:48:17

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

Isaac_Augusto
2022-10-31 12:46:26

Hi,

The FUN is not called at all? or only the GetInput ?

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

mcregdom
2022-11-05 00:22:13

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.

Back to top