Auto turret breaks down for unknown reasons, we need to fix it.
Auto turret breaks down
Can you explain better? Maybe a video?
For example, if you break something nearby, the turret also breaks. While testing on the server and always breaks down at an unexpected moment, it is unclear for what reason.
Merged post
https://www.youtube.com/watch?v=omoQ0icJ_RI
Merged post
https://www.youtube.com/watch?v=omoQ0icJ_RI
Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported since Unity 5.
If you want to use a non-convex mesh either make the Rigidbody kinematic or remove the Rigidbody component. Scene hierarchy path "assets/content/vehicles/minicopter/minicopter.entity.prefab/assets/prefabs/npc/autoturret/autoturret_deployed.prefab/sentry", Mesh asset path "" Mesh name "sentry.base_COL"
If you want to use a non-convex mesh either make the Rigidbody kinematic or remove the Rigidbody component. Scene hierarchy path "assets/content/vehicles/minicopter/minicopter.entity.prefab/assets/prefabs/npc/autoturret/autoturret_deployed.prefab/sentry", Mesh asset path "" Mesh name "sentry.base_COL"
OnGroundMissing is called by its neighbour with Vis
PhysicsChanged -> OnPhysicsNeighbourChanged -> OnGroundMissing.
Quick fix is to keep track of turrets and return not null with OnEntityGroundMissing, but I bet there's a more elegant solution.
public static void PhysicsChanged(GameObject obj)
{
Collider component = obj.GetComponent<Collider>();
if (!component)
{
return;
}
Bounds bound = component.bounds;
List<BaseEntity> list = Pool.GetList<BaseEntity>();
Vector3 vector3 = bound.center;
Vector3 vector31 = bound.extents;
Vis.Entities<BaseEntity>(vector3, vector31.magnitude + 1f, list, 2263296, QueryTriggerInteraction.Collide);
foreach (BaseEntity baseEntity in list)
{
if (baseEntity.IsDestroyed || baseEntity.isClient || baseEntity is BuildingBlock)
{
continue;
}
baseEntity.BroadcastMessage("OnPhysicsNeighbourChanged", SendMessageOptions.DontRequireReceiver);
}
Pool.FreeList<BaseEntity>(ref list);
} I will submit a patch shortly for this. Thanks.
Merged post
Okay. Plugin has been updated numerous times. Enjoy :)
Merged post
Okay. Plugin has been updated numerous times. Enjoy :)
You can just disable the component that is responsible for destroying entities that aren't on a foundation which also removes any unnecessary processing.
Or if the component will never be used you can destroy it using:
entity.GetComponent<GroundWatch>().enabled = false;Or if the component will never be used you can destroy it using:
UnityEngine.Object.Destroy(entity.GetComponent<GroundWatch>());