Demigiant / dotween

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

DOShakeRotation giving an error when applied to a transform. #434

Closed Lucidaeus closed 4 years ago

Lucidaeus commented 4 years ago

_Model.DOShakeRotation(_ShakeDuration, Vector3.one * _ShakeStrength, _Vibrato, _Randomness); This gives the error 'Transform' does not contain a definition for 'DOShakeRotation' and the best extension method overload 'ShortcutExtensions.DOShakeRotation(Camera, float, float, int, float, bool)' requires a receiver of type 'Camera'

Meanwhile: _Model.DOShakeRotation(0.25f, 45, 25, 90); This does not give an error and works as expected.

Also, while at it - is it intentional that if Vibrato is not zero it'll not go back to it's original rotation? That seems rather inconvenient. Could there be an option to have it return to it's original rotation after it's done shaking?

Demigiant commented 4 years ago

Ahoy,

The problem there, I suppose, is that _ShakeDuration is not a float, _Vibrato is not an int or _Randomness is not a float?

About returning to original position/rotation/value, all DOShake methods return to original value regardless of their parameters. The only reason why that might not happen is if you start another shake tween on the same target/property before the previous one has finished, in which case the "original value" will become the current value.

Lucidaeus commented 4 years ago

Ahoy,

The problem there, I suppose, is that _ShakeDuration is not a float, _Vibrato is not an int or _Randomness is not a float?

About returning to original position/rotation/value, all DOShake methods return to original value regardless of their parameters. The only reason why that might not happen is if you start another shake tween on the same target/property before the previous one has finished, in which case the "original value" will become the current value.

Oooh, I must've been blind. I completely overlooked that Vibrato had to be an int and not a float despite looking through it multiple times! Thank you for the clarification!

I checked my console to see if it was called more than once and it indeed is. Not sure why yet but I'll debug and look into it. Again, thanks!

Demigiant commented 4 years ago

Great ^_^