Physics -Individual Gravity

Get help using Construct 2

Post » Wed Sep 04, 2013 12:00 pm

@Ashley
I have a problem on Physics with DragDrop behaviour. Whenever I tried dragging an object with the physics behaviour, if I would to stop moving(Still holding down/dragging), it will fall because of the gravity. So, I decided to set world gravity to 0 when object is dragging/On start drag. Then, set world gravity back to 10 once drop/not dragging. The problem is when I'm playing around with more than 1 object with both behaviours, can cause others to get 0 gravity while dragging one of them. That is why I decided to make this thread and hopefully an individual Gravity event is implemented. The platform behaviour does a great job but not the Physics behaviour. Is there any turn around for this matter? Thanks! :)
B
40
S
9
G
5
Posts: 177
Reputation: 6,795

Post » Wed Sep 04, 2013 12:08 pm

Couldn't you just use while dragging set physics disabled?
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 » Wed Sep 04, 2013 12:14 pm

I got a workaround by setting the world gravity to 0 and apply force X=0, Y=10 when not dragging. It works! But still hope to have that individual gravity implemented. Will Box2DWeb come out with something like this? Cheers :)
B
40
S
9
G
5
Posts: 177
Reputation: 6,795

Post » Wed Sep 04, 2013 12:21 pm

There's the option to set physics disabled, or temporarily immovable while dragging, then there are many options to set friction, density, etcetera.
I don't see what gravity per object would add to all the functionality already present.
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 » Wed Sep 04, 2013 12:24 pm

I'd wanted that throwing effect. Disabling the physics behaviour doesn't work. But thanks anyway!
B
40
S
9
G
5
Posts: 177
Reputation: 6,795

Post » Wed Sep 04, 2013 12:36 pm

Maybe you can replace the object that is being dragged with another object that carries the same sprite while being dragged, and switch back to phsycis object as soon as it is dropped?
B
17
S
4
G
1
Posts: 332
Reputation: 3,099

Post » Wed Sep 04, 2013 12:44 pm

Unfortunately the example capx of the drag and throw effect (as found in the FAQ) seems to be unavailable at the time, but making that effect is entirely possible.

Instead of drag and drop could you just apply a force in the direction of mouse.x,mouse.y based on the distance the mouse travels?
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 » Wed Sep 04, 2013 2:13 pm

works best when you set velocity directly

click+drag

https://dl.dropboxusercontent.com/u/53374990/Forum/PhysDrag.capx
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Thu Dec 26, 2013 9:11 pm

Have found a few different times in my games when it would be nice to have individual world gravity's per item or family. I have found work-around's for every situation but some of them get complex quickly and this would be a great feature.
B
14
S
2
Posts: 39
Reputation: 689


Return to How do I....?

Who is online

Users browsing this forum: luck1210, RedBlackSpade and 5 guests