Jump to content

make a character have 2 different skins?


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)

 

Link to comment
Share on other sites

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

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
×
  • Create New...