Jump to content

Recommended Posts

I'm making a port of the icemaker from shipwreckt to DST and it's all done, but for some reason when I hammer the machine it becomes invisible when the hammer hits.

Also where should I use the code below in my code? I kinda get what it does, but kinda not, so if anyone can explain, I would be grateful :D

inst.entity:SetPristine()

        if not TheWorld.ismastersim then
            return inst
        end

The prefab lua file is at the end of this post.

Thanks in advance for the replies :3

rightbeforebug.jpg

onbug.jpg

icemaker.lua

Edited by Zardexrlz

Maybe the problem is with the anim

 

local function onhit(inst, worker)
	inst.AnimState:PlayAnimation("hit"..inst.machinestate)
	inst.AnimState:PushAnimation("idle"..inst.machinestate, true)
	inst:RemoveEventCallback("animover", spawnice)
	if inst.machinestate == MACHINESTATES.ON then
		inst.components.fueled:StartConsuming() --resume fuel consumption incase you were interrupted from fueltaskfn
	end
end

There is a "inst.AnimState:PlayAnimation("hit"..inst.machinestate)" so it's normal that the anim change when you hammer the machine. So code wise, it seems fine. Problem is probably with the anim itself.

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...