hi i have a little problem ive spent a couple of hours on
i have a stick id like to drag and rotate. ive followed a nice tutorial for it, and it works fine but i only want to rotate my stick 45 degrees when i click it. the tutorial i followed only alows my to rotate 180 degrees ??
this is the code ive used
Code:
handle.grip.onPress = function() {
handle.onMouseMove = function() {
var angle = Math.atan2(this._parent._ymouse-this._y, this._parent._xmouse-this._x);
this._rotation = angle*180/Math.PI;
this.grip._rotation = -this._rotation;
};
};
handle.onMouseUp = function() {
if (this.onMouseMove) {
delete this.onMouseMove;
}
};
please help my i realy would like this to work!!