Get the closest position to the mouse within a radius of your character


How would I go about creating a radius around the character, (kind of like a circle), and then getting a point on that circle (OR INSIDE), depending on if the mouse is inside/outside of the radius/circle. (So if the mouse is inside the circle, the point is where the mouse is, but if the mouse is outside of the circle, it’s on the edge of the circle closest to the mouse.


id use magnitude and unit.
magnitude to check the distance from the character.
unit to place the point towards the mouse if it’s outside the radius.