#Dragging rigidbody from Point
1 messages · Page 1 of 1 (latest)
so this is what happens if I do not use these transform methods, yeah I'm now even more confused
the modifications done
public Vector2 GrabPoint()
{
return _grabbingBody.position + _objectGrabPointPivot;
}
public Vector2 GrabDirectionTowardsCursor()
{
return (PlayerCursorAttachment.CursorPosition() - GrabPoint());
}
_grabbingBody.AddForceAtPosition(
GrabDirectionTowardsCursor() * grabForceMultiplier,
GrabPoint()
);
maybe I need some sleep
what surprises me is that you actually hold onto the local position correctly, yet your direction to grab the object is off
Grabpoint can simply be in world coordinates, and then your direction would simply be GrabPoint - HandPosition.
Now, if you want to hold onto that position, then you would have to convert that world position into local position using InverseTransformPoint
Ok I have manged to solve it, I'll share for those who might be interested