I want to disable networkobject(player) when get out of Aoi(Area Of Interest)

The whole answer can be found below.

Please note: 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! And we offer you support through 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.

I want to disable networkobject(player) when get out of Aoi(Area Of Interest)

ARR
2022-05-26 10:39:41

I'm using a fusion Aoi right now.

However, there was a problem. The player appears to be stopped when the player is out of range. I want to hide the player's mesh so that the player can't be seen. What should I do?

The problem seems to be that if two players are close and far away, the other players stop still. Not even in that position. So I want to make sure that when a player comes into or out of the range, if there is a callback or something like that, if it goes out of the range or comes out of the range to make it's visible.

player doesn't know if the opponent player is standing there or out of the range of interest, so that's the problem now.

Comments

ARR
2022-05-26 18:55:31

I found a way

Calculate before it stop simulation and make it disappear

emotitron
2022-05-27 18:46:51

Yes, typically you will want to have your own handling for visibility that operates on a smaller radius than the Area Of Interest. Area Of Interest doesn't have visibility handling. It just controls when the server does and doesn't cull NetworkObject updates to a client.

IOnEnterSimulation and IOnExitSimulation can be used for simulation related handling (such as disabling colliders), but it should not be relied on for interpolated cosmetics and such.

AOI being simulation related, it is not meant to be directly used for visible fog of war, or visibility in general. You will want to in this case fade objects in and out based on a radius that is smaller than the AOI... so objects fade in/out BEFORE they enter and exit the simulation.

Back to top