Make a instance variable (text) name it state for your obj
the event:
System - Compare two values
Parameters:
Distance(mouse.X, mouse.Y, obj.X, obj.Y)
greater than
100
The Action for obj is:
Set value
Parameters:
instance variable State
value="Close"
You can make as many states as you like. Now make events for your states like this:
obj - compare instance variable
parameters:
instanse variable = State
Comparison = Equal to
Value = "Close"
Add a sub event
Every tick
Action: obj -> rotate toward position parameters:
Degrees = 5
x = mouse.X
y = mouse.y
Action: obj -> move forvard 3 px