Jump to content

Recommended Posts

You can have as many different so-called animation builds as you want, and change between them at will.

Example time! This will change between the "normal" and "special" builds, depending on whether you are above or below 10 in sanity:

local function TurnSpecial(inst)
	inst.AnimState:SetBuild("special")
end

local function TurnNormal(inst)
	inst.AnimState:SetBuild("normal")
end

local function OnSanityDrop(inst, data)
	if inst.components.sanity.current < 10 and not inst:HasTag("playerghost") then  
		TurnSpecial(inst)
	elseif inst.components.sanity.current > 10 and not inst:HasTag("playerghost") then  
		TurnNormal(inst)
	end
end

-- Then, in your master_postinit
inst:ListenForEvent("sanitydelta", OnSanityDrop)

 

2 hours ago, noobyt4 said:

Quick question would i have to rename the second builds parts special1 2 3 etc 

Well, you can't have builds have the same filenames, so yes.

2 hours ago, noobyt4 said:

Another one is i dont want the special build to activate when its at a certain sanity so do i just leave the sanity script out?

It was just an example. You can call those functions wherever you'd like.

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