Simple example:
$(window).mousemove(function(e){
var mousePos = e.pageY
TweenMax.to(elem, 0.35, { y: -mousePos, ease: Power2.easeOut });
});
is there any better way of doing this rather then having an easing every single time the mousePos is updated? Would be nice to have an easeInOut (easeIn when I start moving and easeOut when I stop.
Hi @Noturnoo
I saw your question on Pixi's forum about smoothly following the mouse. The videos above explain how LERP and easing work, which is what Ivan wanted you to lookup.
To get your animation working, you need to change the position of the circ and displacementSprite. And he posted the wrong math function. It should be Math.pow() instead of Math.exp().
app.ticker.add(function(delta) {
const speed = 0.1;
const dt = 1.0 - Math.pow(1.0 - speed, delta)