Updated needed for February update

Buoyancy changes in the February Rust update require this plugin be updated.

Server Exception: Buoyancy Cycle NullReferenceException: Object reference not set to an instance of an object at Buoyancy.BuoyancyFixedUpdate () [0x0011e] in <bfe9a0f816434fa49dbccfb6c004671a>:0 at Buoyancy.DoCycle (System.Boolean forced) [0x0000c] in <bfe9a0f816434fa49dbccfb6c004671a>:0 at Buoyancy.Cycle () [0x0001f] in <bfe9a0f816434fa49dbccfb6c004671a>:0 at ServerMgr.FixedUpdate () [0x0004a] in <bfe9a0f816434fa49dbccfb6c004671a>:0 UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object) UnityEngine.DebugLogHandler:LogException(Exception, Object) UnityEngine.Logger:LogException(Exception, Object) UnityEngine.Debug:LogException(Exception, Object) ServerMgr:FixedUpdate()

I have same error but i do not have this plugin

UdwVsLiQP8DDjHH.PNG ChillRoleplay

I have same error but i do not have this plugin

Any plugin that uses bouyancy will have this error. Bouyant supply drops, helicopter crates, supply drops and jetski all had this error. As far as I know those are all being updated soon. Bouyant helicopters has already been updated.

Merged post

I contacted him on Discord and he says he'll update it.

Still no update :(

I guess this plugin is abandoned. It's a shame.

This modification to the code worked for me to fix this plugin. (Posted in context of entire class.)

  1. Added the "Bounds dropBounds..." line.
  2. Changed arguments passed to WaterLevel.Factor(....).
  3. Passed the _supplyDrop to the BuoyancyComponent(...) call and function definiation.
  4. Added "supply." to the two gameObject assignments.
  5. Added call to "buoyancy.SavePointData();"
#region Classes
class MakeBuoyant : MonoBehaviour
{
	public float buoyancyScale;
	public int detectionRate;
	private SupplyDrop _supplyDrop;

	void Awake()
	{
		_supplyDrop = GetComponent<SupplyDrop>();
		if(_supplyDrop == null) Destroy(this);
	}

	void FixedUpdate()
	{
		if(_supplyDrop == null)
		{
			Destroy(this);
			return;
		}
		
		Bounds dropBounds = new Bounds(_supplyDrop.WorldSpaceBounds().ToBounds().center, _supplyDrop.WorldSpaceBounds().ToBounds().size);
		
		if (UnityEngine.Time.frameCount % detectionRate == 0 && WaterLevel.Factor(dropBounds, true, true, _supplyDrop) > 0.65f)
		{
			_supplyDrop.RemoveParachute();
			_supplyDrop.MakeLootable();
			BuoyancyComponent(_supplyDrop);
			Destroy(this);
		}
	}

	void BuoyancyComponent(SupplyDrop supply)
	{
		Buoyancy buoyancy                  = supply.gameObject.AddComponent<Buoyancy>();
		buoyancy.buoyancyScale             = buoyancyScale;
		buoyancy.rigidBody                 = supply.gameObject.GetComponent<Rigidbody>();
		buoyancy.rigidBody.velocity        = Vector3.zero;
		buoyancy.rigidBody.angularVelocity = Vector3.zero;
		buoyancy.rigidBody.constraints     = RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezeRotationX;
		buoyancy.SavePointData();
	}
}
#endregion

 

to fix this 1 further, it requires true inside the parantheses after SavePointData