Rotation limit

Get help using Construct 2

Post » Tue Aug 06, 2013 1:12 pm

Hi,

i found some threads about limiting rotation angle but i still cant solve it.

My character's arm is rotating towards the mouse but i need to set certain angle range so it wont go backwards. I realize the 0 degree starts horizontally.

Anyone can provide me some example files or ways?

thanks
B
9
S
1
Posts: 80
Reputation: 687

Post » Tue Aug 06, 2013 4:48 pm

anyone has solutions???
B
9
S
1
Posts: 80
Reputation: 687

Post » Tue Aug 06, 2013 6:18 pm

I'm just curious here. How did you make your arm? A sprite pinned to your character?
B
9
S
2
G
2
Posts: 59
Reputation: 1,024

Post » Tue Aug 06, 2013 8:36 pm

Okay so I looked at it quickly
Please take a look at this capx, and see if it's what you need:

http://db.tt/t9UxU3se

I tried a couple ideas but this one is so simple it can hardly fail.
B
9
S
2
G
2
Posts: 59
Reputation: 1,024

Post » Wed Aug 07, 2013 2:36 am

Holy mono.. i didn't think of using mouse.x as a restriction. Thanks!

Btw for the arm, it is a separated arm sprite that i pinned to the player box and setting a image point to the player box's arm.
B
9
S
1
Posts: 80
Reputation: 687

Post » Wed Aug 07, 2013 7:43 am

You're welcome! You should also be able to mirror it if your user wants to walk the other way ;)
B
9
S
2
G
2
Posts: 59
Reputation: 1,024

Post » Wed Aug 07, 2013 8:53 am

I have problems with mirroring it. When i set it to mirror, the rotation only works when the mouse.x is bigger.

I set another event where mouse.x is smaller but it has some weird results..

B
9
S
1
Posts: 80
Reputation: 687

Post » Wed Aug 07, 2013 9:01 am

If you send me a capx I'll have a look at it?
EDIT Made the changes to my own capx. Would this help you?
http://db.tt/pbEWTOSKHoyer2013-08-07 09:48:33
B
9
S
2
G
2
Posts: 59
Reputation: 1,024

Post » Wed Aug 07, 2013 11:38 am

I realized what's the problem after looking at your file. I set mirrored to my arm sprite which gives it the weird rotation. And then i need to add the 'flip' so that the arm is not upside down when i go left.

Thanks Hoyer!

Btw, when the mouse is too close to the arm sprite, the 'set angle towards' is not working. Any ways to get past that?
B
9
S
1
Posts: 80
Reputation: 687

Post » Wed Aug 07, 2013 11:46 am

@iikii,

My first guess would be your origin is in the middle of the sprite instead of on one end, am I right?
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

Next

Return to How do I....?

Who is online

Users browsing this forum: beguinner, mcscooter, totoe and 20 guests