Skip to content

Commit

Permalink
update lerp value #1
Browse files Browse the repository at this point in the history
  • Loading branch information
positlabs committed Mar 7, 2023
1 parent 6abf494 commit a8cf0ba
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ var colorA = script.colorA
var colorB = script.colorB

anime({
targets: {x: 0},
x: 1,
duration: 1,
loop: true,
direction: 'alternate',
easing: 'linear',
update(anim){
material.mainPass.baseColor = vec4.lerp(colorA, colorB, anim.progress*.01)
material.mainPass.baseColor = vec4.lerp(colorA, colorB, anim.animations[0].currentValue)
}
})

0 comments on commit a8cf0ba

Please sign in to comment.