Arms of sprite to follow mouse

Get help using Construct 2

Post » Tue Nov 26, 2013 12:46 pm

I'm messing around and trying to create a prototype for a side scroller shooter.

Now what I am aiming to do is be able to move a sprite, but have the arms be able to follow the mouse. (As to aim.)

I've got the moving and everything else down easily enough.

I have created 2 seperate sprites, one being the Body and the other as the Arm.
I've Pinned the Arm to the Body sprite, I'm unsure if that is how I should go about it.

But I am not able to make the Arm follow the mouse, essentially have it swivel on the Body and aim where I am pointing while the body stay where it is.

Could anyone give any insight on how I could remedy my frustration on this?

(I would check the manual, but I am having trouble accessing the Main Scirra website at the moment.)
B
11
S
4
Posts: 13
Reputation: 1,142

Post » Tue Nov 26, 2013 12:59 pm

Arm set angle towards position x: mouse.x - y: mouse.y

for this to work the origin of your arm should be on the turning point.
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

Post » Tue Nov 26, 2013 1:10 pm

Ah, Thanks Heaps, fixed my issue.

Was a simple one, I was making it Set Position for some reason instead of Set Angle Toward Position. Always the small overlooks that get me.
B
11
S
4
Posts: 13
Reputation: 1,142


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests