I am new in unity and I am developing a game where I want to rotate my object I try this code for it.
if(Input.GetMouseButton(0)){
if(Input.GetMouseButtonDown(0)){
LastMousePosition = Input.mousePosition;
}
else if(LastMousePosition.y> 112){
Bow.Rotate(Vector3.up*(Input.mousePosition.y - LastMousePosition.y));
}
else if(LastMousePosition.y<112){
Bow.Rotate(Vector3.down*(Input.mousePosition.y - LastMousePosition.y));
}
LastMousePosition = Input.mousePosition;
}
It works fine for me but my object is rotate from It’s center point and I want to rotate it from another point can any one help me with this?
Thanks in advance…
Regards,