Demigiant / dotween

A Unity C# animation engine. HOTween v2
http://dotween.demigiant.com
Other
2.37k stars 352 forks source link

Allow Shake/Punch generic methods to work with floats #1

Open Demigiant opened 9 years ago

Demigiant commented 9 years ago

Original from jedhubic on Google Code (Issue 33):

Hey there, been loving DOTween and was an instant donator after my first use. I was wondering if it's possible to add tweening on the generic methods to apply to floats as well? Right now the getters/setters require Vector3s, which, are easy enough to work with on variables I've created, however some scripts and stuff that I'm using would benefit greatly if I were able to apply tweening like punch or shake on a float value (camera distortion is one example). Hope that makes sense??? Thanks!

AemaethMonster commented 6 years ago

This is also the function I want... But it raises in 2015╮(ツ)╭ Maybe I should just shake a Vector3 then get the .x

Demigiant commented 6 years ago

I completely forgot about this :P I think I remember trying a single-float shake, but I wasn't satisfied (though my memory is horrible). But yup, for now I'd recommend shaking a Vector and getting its X value :P

maartenwiedenhof commented 3 years ago

I would like this as well. I imagine that punching a float would look look like a sort of diminishing sine wave. It would be great for cases where you are animating a rotation: you could create a sort of harmonic vibration effect.

MrDizzle commented 6 months ago

I know necro, but I'm always wanting to punch floats, it's just a very useful way to animate a value as it gives you a yoyo effect without applying loops and curves.