Hello,
I want to make a 3d object rotate smoothly when being dragged in a UI.
My stuff currently works but I just can’t get it to rotate smoothly, I can only make it rotate instantly which looks bad.
So my question:
How do I make the Object rotate smoothly if this code here makes it rotate instantly?
void IDragHandler.OnDrag(PointerEventData eventData)
{
mousePositionDelta = Mouse.current.delta.ReadValue();
float dotProduct = -Vector2.Dot(mousePositionDelta, uiCamera.transform.right);
characterModelTransform.Rotate(transform.up, dotProduct*characterRotationModifier);
prevMousePosition = eventData.position;
}
Thank you for any answers in advance ^^