Rotating Sprite 2D with JAVASCRIPT coding.

I am building a game and I am facing a problem. I am trying to make a sprite (=CannonSprite) which can rotate randomly and shoot an object in unspecific time.Could you please help me ?

No it is working but it doesn’t do what I want it to do

Maybe this is a suitable introduction: Unity official - Making an Angry Birds style game

As for Javascript… for various reasons most people consider C# to be the better option in Unity, but you should generally be able to translate from one language to the other:

Unity official - C# vs Javascript Syntax