Jump to content

Masts no longer have sinking effects


Hornete
  • Pending

1913383396_GIF11-29-20216-04-39PM.gif.e7adf7691c134dcd13648f542e20875a.gif

Masts used to have a sinking effect when the boat they are on was destroyed.
 

function Mast:OnRemoveEntity()
	local mast_sinking

	if self.boat ~= nil and self.sink_fx ~= nil then
		mast_sinking = SpawnPrefab(self.sink_fx)
    else
        mast_sinking = SpawnPrefab("collapse_small")
	end

	if mast_sinking ~= nil then
		local x_pos, y_pos, z_pos = self.inst.Transform:GetWorldPosition()
		mast_sinking.Transform:SetPosition(x_pos, y_pos, z_pos)
	end

    if self ~= nil then
        self:SetBoat(nil)
    end
end

It's most likely because self.boat becomes nil when the boat is destroyed.
 

self.OnBoatRemoved = function() self.boat = nil end



perhaps the mast could just check if it's on ocean, and if it is, spawn the sinking effect, if not(its on land rather), then spawn the collapse_small prefab.


Steps to Reproduce

1. Place mast on boat
2. Destroy boat
3. Noooo mooore sinking effects

  • Like 3



User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...