How do I set max acceleration/fallspeed for physics objects?

Get help using Construct 2

Post » Sat Sep 17, 2016 2:16 pm

I'm having physics objects fall into a platformer and the height they fall from gives them a lot of time to accelerate, causing them to fall way too quickly. Is there a way to set their maximum fall speed?

P.S. They fall from various heights, so changing their original height isn't a solution.
B
7
S
1
Posts: 4
Reputation: 405

Post » Sat Sep 17, 2016 2:37 pm

You can create a maximum speed variable and an event to prevent the object from going beyond the max speed.
Constant Variable MaxSpeed = 30
If [your object].velocity > MaxSpeed --> Set [your object].velocity to MaxSpeed
B
29
S
10
G
10
Posts: 97
Reputation: 6,614

Post » Sat Sep 17, 2016 2:44 pm

B
29
S
10
G
10
Posts: 97
Reputation: 6,614

Post » Sat Sep 17, 2016 2:48 pm

Lumbearjack wrote:I'm having physics objects fall into a platformer and the height they fall from gives them a lot of time to accelerate, causing them to fall way too quickly. Is there a way to set their maximum fall speed?

P.S. They fall from various heights, so changing their original height isn't a solution.


Here is another method. :mrgreen:

https://www.dropbox.com/s/7s4vs3c8zde0n ... .capx?dl=0
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Sat Sep 17, 2016 4:03 pm

Thanks for the responses!

@Makotto, I went with your solution. it makes complete sense. I didn't realize you could use a '.physics' of an object. Just didn't occur to me. Thanks!

@Gmoney, I didn't realize that was what the force attribute could be used for, I thought it was literally to apply force on an object as if it were being hit. Though I suppose that's what impulse is for. I don't fully understand what is happening with force.
B
7
S
1
Posts: 4
Reputation: 405

Post » Sat Sep 17, 2016 5:19 pm

Lumbearjack wrote:Thanks for the responses!

@Makotto, I went with your solution. it makes complete sense. I didn't realize you could use a '.physics' of an object. Just didn't occur to me. Thanks!

@Gmoney, I didn't realize that was what the force attribute could be used for, I thought it was literally to apply force on an object as if it were being hit. Though I suppose that's what impulse is for. I don't fully understand what is happening with force.


You're welcome, Lumberjack. :mrgreen:

That's what I've found on my own, while experimenting with physics, when I needed to have more than two objects falling with unique velocity.

To be honest with you, I'm not sure about how the force is affecting the balls to fall slower (or faster).

I've been using the force to achieve random velocity effects I needed on free falling object instances, in order to get realistic looking free falls.

I've read Ashley's tutorial below (and C2 manual) to find an answer for that, but I wasn't sure how the force was doing what it was doing in my games. :?

https://www.scirra.com/tutorials/65/phy ... and-joints
B
11
S
6
G
15
Posts: 256
Reputation: 9,207


Return to How do I....?

Who is online

Users browsing this forum: RIDETHEPIG and 8 guests