How do I clamp mouse to object ?

Get help using Construct 2

Post » Fri Oct 28, 2016 8:25 am

hi guys, how can I stop my sprite ( that has position to mouse cursor) when it touches a object ?

thanks
B
37
S
16
G
2
Posts: 451
Reputation: 4,873

Post » Fri Oct 28, 2016 2:33 pm

How are you attaching it to the mouse?

In our instances we use an:
Every tick; if(locked==1):
Object.X = Mouse.X; Object.Y = Mouse.Y

then we just set locked = 0 and it stops
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Fri Oct 28, 2016 8:00 pm

like this: position to mouse.x position to mouse.y...

...can u post a capx please ?
thanks
B
37
S
16
G
2
Posts: 451
Reputation: 4,873

Post » Fri Oct 28, 2016 10:13 pm

https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Sun Oct 30, 2016 10:12 am

thanks so much !!!!!!!!!!!!!!!!!
B
37
S
16
G
2
Posts: 451
Reputation: 4,873


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests