Notifications
Clear all

[Closed] Expression question

Hey guys I’m pretty new into scripting, i just need some advice on what im doing wrong

I have this expression which is for stretching a bone which works fine

dependsOn foot
orig = 196
d =(distance ankle fino)
if d > orig then xPos = 0 + (d-orig) * stretch
else xPos = 0

I tried adding another line of code which would make it squash

dependsOn foot
orig = 196
d =(distance ankle fino)
if d > orig then xPos = 0 + (d-orig) * stretch
if d < 155 then xPos = 0 – (155-d) * squash
else xPos = 0

But when I run this expression it only does one of them, either the squash or the stretch depending of how I arrange the expression.

Anybody know what is wrong with this?

2 Replies

orig = 196
d =(distance ankle fino)
xPos = 0
if d > orig then xPos = 0 + (d-orig) * stretch
if d < 155 then xPos = 0 – (155-d) * squash

na that still didn’t work gave me the same result as before.

I think it this happening because I have 2 if statements,

But ive already tried everything I can think of, but it usually the simplest answer