(How do I) pin arms to body and follow mouse

Get help using Construct 2

Post » Thu Oct 24, 2013 5:46 pm

Hi dear cosntruct 2 users!
I would like to pin two arms on my main charcater and let them follow the mouse's cusror. In an esy way, how could I do this? And for the capx files, if you need it, please explain me how to publish it XD thanks!
B
8
S
1
Posts: 16
Reputation: 536

Post » Thu Oct 24, 2013 6:20 pm

set the origin of the arm where you'd like the turning point to be.
give the arm pin behaviour (position only)
on start of layout pin arm to body.
system every tick arm set angle toward mouse.x , mouse.y
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 » Thu Oct 24, 2013 6:25 pm

To illustrate the thing about the pivot point, make sure the origin point on your arm is opposite its default 0 angle, so that it will "point" properly. If the origin is at the center point it will just pivot like a windmill.

Here's a quick exampleWertle2013-10-24 18:26:25
B
11
S
2
Posts: 87
Reputation: 1,112

Post » Thu Oct 24, 2013 7:10 pm

Here is my game:
https://www.dropbox.com/s/6jccvtkb7r1l4z9/The%20Janitor.caproj
I try to do it in the Gunslinger group
B
8
S
1
Posts: 16
Reputation: 536

Post » Fri Oct 25, 2013 1:54 am

IT doesnt work
B
8
S
1
Posts: 16
Reputation: 536

Post » Fri Oct 25, 2013 6:09 am

[QUOTE=pixelcataklysm] Here is my game:
https://www.dropbox.com/s/6jccvtkb7r1l4z9/The%20Janitor.caproj
I try to do it in the Gunslinger group[/QUOTE]

You need to send a capx, not a project. Can't open it and help you atm.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

Post » Sat Oct 26, 2013 4:45 am

https://www.dropbox.com/s/u5p4ruo1njl6oa5/The%20Janitor.capx

here it is, I notice that the arm actually multiply itself and for the limit angle will be my next homework to study :P

PS: sorry for my broken english :S still learning ^^
B
8
S
1
Posts: 16
Reputation: 536

Post » Sat Oct 26, 2013 7:55 am

You are spawning a new arm every tick while the group gunslinger is active. Jut add a system trigger once while true condition to the spawning event and it works..
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 » Sat Oct 26, 2013 5:26 pm

Did I have to do an instance variable for the arms with system/trigger once while true?
B
8
S
1
Posts: 16
Reputation: 536

Post » Sat Oct 26, 2013 5:27 pm

By the way thank to hepl me out with this little problem, Im still learning every day :D
B
8
S
1
Posts: 16
Reputation: 536

Next

Return to How do I....?

Who is online

Users browsing this forum: alextro, georeb, ivanski1983, Ryan Kocourek, ultrafop and 7 guests