shooting and hit script JS

Hi im new to unity and i m making a little shooting game were you need to shoot some ducks on a fair.

when it hits the duck it should rotate -90 degrees.

so i inserted this script to my duck:

var bullet; function OnCollisionEnter (hit : Collision) { if(hit.gameObject.tag == bullet){ print ("test hit"); hit.gameObject.rotation.x = -90; } }

after addings this code it just dont work anyone??

thnx alot

.rotation is a quaternion, yet you set it to an euler angle

try .Rotate() instead

here are the docs for more detaled information about the method Rotate() http://unity3d.com/support/documentation/ScriptReference/Transform.Rotate.html