Jump to content

Help: How to have different art for right looking face and left looking face? (aka, when your character is turned right or left)


Recommended Posts

I am following the Sample Character mod, and there is only one set of face templates for when the character is looking on the side.

 

post-467982-0-28595000-1416845540_thumb.

 

From that I realised the characters' faces just get mirrored when they look on the opposite direction, but my character has only one eye, the left one, so if he looks to the right his eye is isn't visible.

 

How can I solve this problem?

You will need to do two builds one containing an eye and one not.  Then when looking the direction you want you will need to actually swap the build so you're using the other artwork.

That means you need to apply a different animation when the guy's looking the other way. Or you make an entirely new animation (not practically an option)

You think you can run a function that continuously checks inst.AnimState:GetCurrentFacing() and depending on that replace your character's inst.AnimState:SetBuild(). 

Tried this, seems to work pretty good from prefab

    inst:DoPeriodicTask(0.01, function (inst)	    if inst.AnimState:GetCurrentFacing() == 0 then		    inst.AnimState:SetBuild("wilson")	    else		    inst.AnimState:SetBuild("webber")	    end    end)
 

I'm sorry, you should be able to find your way from here. Perhaps read a guide about making your own character. All you need for my code to work is one extra texture and to know which prefab file is your character's.

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