Articulated arm

Get help using Construct 2

Post » Sun Mar 03, 2013 8:25 pm

Hello !
thanks to some of you (Nimtrix), I've been able to understand a bit more how to rotate a sprite using mouse/touch.
I've been trying to achieve a sort of inverse cinematic function to be able to move an arm made of different connected part. It works somehow but, checking the included .capx, you'll see that a lot has to be done. And I'm stuck.
- Movement is not really efficient
- I'd need arm parts to move according angle constraint.

Do you have any idea on how I could implement that ?

Thanks in advance !!

ArticulatedSkeleton.capx
B
21
S
9
G
4
Posts: 197
Reputation: 4,105

Post » Mon Mar 04, 2013 8:51 am

I considered again the problem and wonders if I shouldn't apply the rotate routine to every part instead of puting them into a family but it doesn't seem to doany good.
Any helpwould be really appreciated.
B
21
S
9
G
4
Posts: 197
Reputation: 4,105

Post » Tue Mar 05, 2013 5:00 am

I downloaded the capx to have a look but since it's saved with the beta release, I couldn't open it. Sorry.
B
7
Posts: 38
Reputation: 476

Post » Tue Mar 05, 2013 8:51 am

@ Curious Mike : Oh ! Too band ! Can't you update tothe beta release ?

Is it the same for anyone ?
B
21
S
9
G
4
Posts: 197
Reputation: 4,105

Post » Tue Mar 05, 2013 10:08 am

Is this what you were looking for:

Skeleton arm

Be sure to rotate your bone frames to face towards right (angle 0) by default, it simplifies many things. I did with arm bones there.

Also, using physic joints might simplify this if you intend to limit possible joint angles.vee412013-03-05 10:15:46
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Mar 05, 2013 10:28 am

@Vee41 : My saviour ! That's exactly what I needed ! Thanks ! Do you have an idea about how to constraint movement to a certain angle ?
B
21
S
9
G
4
Posts: 197
Reputation: 4,105

Post » Tue Mar 05, 2013 10:32 am

I'd take a look at physics behavior: https://www.scirra.com/manual/98/physics

More specific; torques and limited revolute joints: https://www.scirra.com/tutorials/65/physics-in-construct-2-forces-impulses-torque-and-joints

You could also do it by limiting angles via instance variables and checking that they are not exceeded.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Mar 05, 2013 10:43 am

@vee41 : thanks for the advice, unfortunately, I'm not that good in programming to deal with those notions. If you feel you can help, I'll be honored.
B
21
S
9
G
4
Posts: 197
Reputation: 4,105

Post » Tue Mar 05, 2013 12:49 pm

Here is a quick example how you could do it with physics:

Skeleton arm - physics

I'm not that familiar with physics behavior, but hopefully this gives you an idea how to do it and you can use this to fine tune your approach :)
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Mar 05, 2013 5:06 pm

@ vee41 : that's it ! Mouvement is a bit fluid but that's what's I wanted. Looks quite natural. Thanks so much for your time !
B
21
S
9
G
4
Posts: 197
Reputation: 4,105

Next

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, abdalghani, Ethan, Marxally, Naightwolf and 17 guests