Orienting a player's arm to the mouse

Get help using Construct 2

Post » Sun Aug 04, 2013 12:12 pm

Hi folks,

I'm new here and I ran through the basic tutorial yesterday and everything makes sense, Construct 2 is a great tool, especially for me, since I have no mind for code whatsoever.

Today I decided to test out an idea I had and see if it's feasible at all.

Basically, I want the sprite's forearm to follow the mouse, and the arm to follow the forearm, as a kind of backwards skeleton. What I'm aiming to do is to give the player control on swinging a weapon.

This is my sprite here:



The arm and the forearm are separate objects.

And here is how I've set up my Events sheet for the arm motion.



(I've since corrected "forearm is visible" to attach to arm, rather than itself)

The problem this seems to make is that the upper arm constantly rotates clockwise.

Any ideas on how to fix the events? Or, if you have an idea of a better way of doing this, I am open to suggestions! Thanks! :)
B
5
G
1
Posts: 22
Reputation: 467

Post » Sun Aug 04, 2013 6:50 pm

Your events look good, so I cant see the problem unless you upload a capx or a demo.
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Mon Aug 05, 2013 12:23 am

Thanks :) I realize now the problem is not the arm anymore...I'm just not sure how to straighten out the whole structure.

Here's how it looks so far:

http://www.screenr.com/BoAH

EDIT: I tried another test, this time with the arm as one sprite. This does fix all of my problems with the more complex setup, but limits the range quite a lot...Might need to make an executive decision to keep it simpler.

http://www.screenr.com/DoAHAllbrotnar2013-08-05 01:04:51
B
5
G
1
Posts: 22
Reputation: 467

Post » Mon Aug 05, 2013 2:43 am

I did some test and this is the best I could:

https://www.dropbox.com/s/6o53lasjqzk87gw/arm.capx
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Mon Aug 05, 2013 5:28 am

I found this on the forums

https://www.dropbox.com/s/4dyd1ieqo3cwhzw/armexample.capx
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Mon Aug 05, 2013 8:29 am

Thanks a lot! Still undecided as to which system I'll be using, but this definitely helps me get to grips with Construct better! :)
B
5
G
1
Posts: 22
Reputation: 467


Return to How do I....?

Who is online

Users browsing this forum: COcatdog, ColombageEnPLS and 11 guests