Detect if player is in monument bounds?
Currently i have a if function to see if player is in a monument

 if (player.currentTimeCategory == 2)
            {               
                //player in munument
            }
            else
            {
               //player not in monument
            }​

and that works to a degree
problem is that only works if player is at ground level ,
example : if player is in water treatment by recycler ,(that is on second level of building) the shows that player is not at monument ..

any better way to do this..that detects all of monument not just ground level .

and no i dont want to use Zone Manager and place zones all over map.

Every MonumentInfo have bounds. You can check if player is in that bounds
Thanks for the reply @Orange very helpfull ...
 bool IsplayerAtMonument(BasePlayer player)
        {
            foreach (var monument in TerrainMeta.Path.Monuments)
            {
                if (monument.Bounds.Contains(player.transform.position))
                {
                    player.ChatMessage($"monument {monument.name}");
                    return true;
                }
            }
            player.ChatMessage(" not monument");
            return false;
        }​

im trying this but it allways returns false........ hahaha i dont know how to check if player is in bounds

Merged post

wait found it
 bool IsplayerAtMonument(BasePlayer player)
        {
            foreach (var monument in TerrainMeta.Path.Monuments)
            {
                if (monument.IsInBounds(player.transform.position))
                {
                    player.ChatMessage($"monument {monument.name}");
                    return true;
                }
            }
            player.ChatMessage(" not monument");
            return false;
        }
​

but it seems its not detecting launch site ... buzy testing rest

Merged post

ok so only monuments that that does not pickup is oilrigs , escavator and launchsite

dont know why

Merged post

and lighthouse
did you try scan threw
foreach ( var monument in UnityEngine.Object.FindObjectsOfType<MonumentInfo>() )
@Ts3hosting yes i have and ist the same thing . did find out that lunch only picsup from rocket to main building , and escavator from main building to farming arm....
light house and oilrigs seem to be becuse they dont have a size in monument.bounds

im trying to calculate distance from player to monument center but need some help with way to do that ....

but we will see where it leads me

Merged post

 bool IsplayerAtMonument(BasePlayer player)
        {
            foreach (var monument in UnityEngine.Object.FindObjectsOfType<MonumentInfo>())
            {
                if (monument.IsInBounds(player.transform.position))
                {                   
                    return true;
                }
                if (Vector3.Distance(monument.transform.position,player.transform.position) <= monument.Bounds.size.x || Vector3.Distance(monument.transform.position, player.transform.position) <= 40f)
                {
                    return true;
                }
            }
           
            return false;
        }

best way i got working , and it includes a 40meter check for lighthouse and oilrigs