Input Authority problem
The whole answer can be found below.
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).
Input Authority problem
kroko
2022-04-03 15:15:34
I am trying to make a simple rigidy body based movement and I ve run into an issue.
Host can control his player. The other player prefab should be controled by the other player but instead it doesn't respond to anyone's input.
Here is the movement code.
Here is the Spawning function.
Host's network object.
Client's network object.
I am coming from photon PUN 2 where you just typed view.IsMine and everything worked, however It seems that in fusion its more complicated. Im looking forward to understanding this concept in fusion.
Comments
Hi @kroko ,
Thanks for using our products.
Fusion is not complicated, it is just different from PUN. 😉
Please, follow the Fusion 101 Series and you should be able to accomplish what you want pretty easily: https://doc.photonengine.com/en-us/fusion/current/fusion-100/overview
--
Ramon Melo
Photon Fusion Team
@ramonmelo I really feel like this doesnt answer my question at all. I have already visited fusion docs this site has to provide that is including the whole fusion 101 serie. I don't feel like copying and pasting all the code from the one example that is provided on the site. The example doesn't match my goals, which are just having a simple physics based movement without overdoing the whole task. If you could maybe point out some problems with the solution I have written and proposed that would fulfil my expectations.
Hi @kroko ,
I don't feel like copying and pasting all the code from the one example that is provided on the site
This would be the best way to learn how Fusion works, by looking at the samples and testing them yourself.
The example doesn't match my goals, which are just having a simple physics based movement without overdoing the whole task
That is what is shown in the Fusion 104 doc: https://doc.photonengine.com/en-us/fusion/current/fusion-100/fusion-104
If you could maybe point out some problems with the solution I have written and proposed that would fulfil my expectations.
Sure.
If you are using ClientServer mode, then you need to use the Fusion Input System, which is explained here: https://doc.photonengine.com/en-us/fusion/current/fusion-100/fusion-102 . You are reading the local input on a FixedUpdate
Loop, which is not used by Fusion, you need to use FixedUpdateNetwork
instead, and inside it, use the GetInput
in order to get the input from your client.
Also, you are assigning the Input Authority in one run at some point in time of your simulation, you should instead spawn and assign Input Authority when a Client joins the Game Session, this is also demonstrated in the link above.
If you want to check a ready-to-go example of a moving physics sphere, take a look at the "Hello Fusion" sample here: https://doc.photonengine.com/en-us/fusion/current/hello-fusion/hello-fusion . It is basically a playground scene with some obstacles.
--
Ramon Melo
Photon Fusion Team
Howdy!
I had a similar problem and you need to swap your FixedUpdate to public override void FixedUpdateNetwork().
Hope it resolves your issue.
Back to top