[Solved] Applying physics joints in-game?

Get help using Construct 2

Post » Sat Apr 12, 2014 10:23 am

Hi there.
So far using Construct I haven't found many things that I have not been able to figure out one way or another, but this has really got me confused.

I've started a test of using physics constraints in-game, but I can't seem to get it working.
Here are my problems so far:
1. the normal physics constraints/joints rely on the use of image points, which means that they then can't be accurate to where one's mouse is pointing. I'm using the mouse to apply a nail object which - all going well - would allow the objects behind it to revolve around the point where the nail is. That doesn't work though, because the join is based on the image point as in the below screenshot.
Construct Issue.png

2. I can't use image points for so many reasons: it has to be accurate or the join won't look anything like it should, I would need to find the closest image point to the nail from both objects and compromise, and overall I don't really feel like adding another 2-10 image points for each of the objects I'll have.
3. Pin doesn't work with physics behavior. I think this also because when I apply the pin, it tries to pin A to B and B to A again, and since I'm using one family/object to do this, I can't really - as far as I know - get around this.

So I guess what it comes down to is: Using physics behavior, is there any way to stick things together.

Thanks.
You do not have the required permissions to view the files attached to this post.
Last edited by Sumyjkl on Sun Apr 13, 2014 5:28 am, edited 1 time in total.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Sun Apr 13, 2014 4:23 am

Seems I fixed it (to an extent) and I'm not entirely sure how. Here's the updated nail constraint events:
Construct Issue Solve.png

As you can see the only difference is that this means the nail attaches to the two objects rather than the two objects attaching to the nail. Also for some reason doing it in the same event (instead of separating the top and bottom instances) breaks it, in a way that it for some reason only attaches to one object.

There's still the issue that this will only work with two objects (the top and bottom) but that can be fixed with a for loop:
Construct Issue Solve extra.png


Now I just need to make a physics driven drag and drop system...
You do not have the required permissions to view the files attached to this post.
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Fri Apr 25, 2014 8:27 pm

I will try to implement this later, I have been trying to figure out something similar.
B
13
S
5
G
1
Posts: 119
Reputation: 2,292


Return to How do I....?

Who is online

Users browsing this forum: David181, vaticant and 4 guests