# [FIXED] How do I make object follow Mouse on certain degree

Get help using Construct 2

### » Thu Nov 19, 2015 4:17 pm

Hello,
I'm stuck at figuring out how to make an object (e.g. a head) follow the mouse, but only between certain angles.

Added a pic to better picture it (huehue)

P.S. The layout is rotating, so the angle (of the player) is changing, but I'll figure that out somehow... just the basics first...
Has anybody an Idea how to do it?
Last edited by Icon3x on Fri Nov 20, 2015 9:04 pm, edited 1 time in total.
B
5
S
1
Posts: 12
Reputation: 576

### » Thu Nov 19, 2015 4:36 pm

I guess you could use the system is between angles condition..
I would use the body angle to compare with, in this case..

so that would be something like this:

else
> head rotate 1 degrees towards body.angle
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

### » Thu Nov 19, 2015 4:45 pm

Another way would work with the clamp expression

System every tick

Problems that could arise are that sometimes the expression(s) return negative angles..
If this is the case and it messes up the actions, adding 360 when values are negative should solve this..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

### » Thu Nov 19, 2015 10:04 pm

https://www.dropbox.com/s/nkwa654q4s3hs ... .capx?dl=0
B
44
S
11
G
10
Posts: 233
Reputation: 7,819

### » Fri Nov 20, 2015 9:27 am

Thank you guys so much! Every time I tried it the head would flicker back. This is so helpfull!
I'm gonna try all the examples, so see which fits best my needs.
But just omg, I can't belive how happy I am right now
B
5
S
1
Posts: 12
Reputation: 576