Jump to content

So, what am I messing up here?


Recommended Posts

Hey all, this is embarrassing to ask but I can't figure out how to properly indent this chunk of code. The character's face is asymmetrical so I'd like him to look different when he faces left and right. I found a previous topic where someone figured out the coding but, I'm a complete newbie so I don't know the proper way to apply it. How should it be done?

 The game seems to get hung up on the last few bits of text with all the 'end' statements, which is why I'm assuming it's just me not indenting properly.

And here's the actual code. The character in question is an alternate Wilson based on a friend's fanfic in case the name is offputting!

if there's any other files I should upload, let me know!

Edited by WORLDSBIGGEST
Link to comment
Share on other sites

This should be it, https://i.gyazo.com/b3a333e1ef58ec81c61bc369c3cba7e3.png

btw here's a super simplified version of the side animation function, should work;

local function ChangeAnim(inst)
	if inst.AnimState:GetCurrentFacing() == 2 then -- left
		inst.AnimState:SetBuild("woundson_left") 
	elseif inst.AnimState:GetCurrentFacing() == 0 then -- right
		inst.AnimState:SetBuild("woundson_right") 
	end
end

 

Edited by Aquaterion
Link to comment
Share on other sites

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
 Share

×
  • Create New...