Discussion in 'Rust Development' started by miRror, Jun 18, 2017.
Does not work: http://joxi.ru/YmEkoXNT0WORyA.png
did you try typing :
in your server console?
Edit: sorry just reread it, didn't see the code you was working on
I'm not 100% familiar with this, but surely your list "entities" would have nothing in it prior to your foreach?
private class SphereTrigger : MonoBehaviour
private int _sphereID;
public void Init(int sphereID, float radius)
_sphereID = sphereID;
gameObject.name = "SphereTrigger";
gameObject.layer = (int)Layer.Reserved1;
var collider = gameObject.AddComponent<SphereCollider>();
collider.radius = radius;
collider.isTrigger = true;
void OnTriggerEnter(Collider col)
BasePlayer player = col.gameObject.GetComponent<BasePlayer>();
if(player == null)
Interface.CallHook("OnSphereEnter", player, _sphereID);
private void CreateSphere(int sphereID, Vector3 position, float sphereRadius, float triggerRadius)
SphereEntity sph = GameManager.server.CreateEntity("assets/prefabs/visualization/sphere.prefab", position) as SphereEntity;
sph.currentRadius = sphereRadius;
sph.lerpSpeed = 0f;
var component = sph.gameObject.AddComponent<SphereTrigger>();
If use var component ..., then all works perfectly, but without SphereCollider to delete a sphere is not possible.
Why you need to use worst Vis?
You know any method?
I think you need to approach this differently.