I'm currently in a lesson working with basic expressions. The task was to create an expression that would make an oil lamp swing on it's hinge. My original code:
PHP Code:
//values are keyed to Impact=50, Dropoff=200, Amp=30
$angleZ = 0;
if (frame > Handle2.Impact){
$angleZ = (Handle2.ImpactDropoff / frame);
$angleZ = $angleZ * (Handle2.Amplitude / 2);
}
Handle2.rotateZ = sin(frame / 5) * $angleZ;
PHP Code:
$angleZ = 0;
if (frame > Handle2.Impact){
$angleZ = (Handle2.ImpactDropoff / frame) * (Handle2.Amplitude / 2);
}
Handle2.rotateZ = sin(frame / 5) * $angleZ;
I can't see at all how the two expressions could possibly run differently, especially as the variable is modified before the angle in both cases. Can someone please explain what is happening?