Raycasts not working in multi-peer mode
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).
Raycasts not working in multi-peer mode
RefraX295
2022-10-30 10:36:07
Hi,
I am unable to get raycasts to return any hits when using multi-peer mode in photon fusion. I have no issues when using single-peer mode. Am I missing something?
The raycasts are needed for clientside logic and I have tried calling the raycasts from Update, FixedUpdate, Render and FixedUpdateNetwork without luck. I have also tried the LagCompensation.Raycast functions with the same issues.
Edit: Turns out I just had to use the Runner.GetPhysicsScene() to do the raycasts, since each peer gets their own physics scene.
Comments
Isaac_Augusto
2022-10-31 12:41:56
Hi,
Yes, in multi-peer you need to use Runner.GetPhysicsScene()
to refer the correct physics scene.
Isaac Augusto
Photon Fusion Team
Back to top