MouseX/MouseY within limits

Hello,
I’m trying to figure something out for one of the games I’m making, and I couldn’t find the solution on previous posts.

The thing is: I changed the position of my custom cursor/arrow to MouseX/MouseY. But I’d like to do that within a rounded limit. - In other words: my actual cursor could be on the ‘‘final right’’ of the scene, but the custom cursor will be showing within the estipulated circle/radius.

I imagine that there must be some kind of function to add to MouseX/MouseY to apply this limit considering a certain radius, but I’m not sure if this is the right way to proceed.

Does anyone have a clue? thanks!!

I would just add conditions to your event. There’s one that is “Cursor X position” and one that is “Cursor Y position” as conditions.

Use those and just set X < your minimum x limit, another X > your maximum limit, etc.

Hi, thanks for the reply.
Unfortunately, this way creates just a “square” limit. I’m trying to create a “circle/rounded” limit, which is why I think it needs to include the radius, but I don’t know the function.

PsuedoCode suggestion:
If CenterPoint.DistanceToPoint(MouseX, MouseY) > Radius
→ Put Cursor around CenterPoint at angle “CenterPoint.AngleToPosition(MouseX, MouseY)” and distance “Radius”

1 Like