How Do I Subtract From Bullet Speed

Get help using Construct 2

Post » Tue Aug 25, 2015 1:54 am

I want it so that over time my bullets speed decreases and stops at 0. Can anybody help?
B
5
Posts: 18
Reputation: 269

Post » Tue Aug 25, 2015 2:34 am

Just give the bullet behavior a negative acceleration value, which will slow it to zero over time. Alternatively, set the object's speed(from the bullet behavior) to something like this:

Code: Select all
Object.Bullet.Speed - RateOfDeceleration * dt

The behavior doesn't seem to allow negative speeds, so this more or less stops at 0, though things seem to get wonky when it hits that point, so you may clamp that value between 0 and some absurdly high value.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,106

Post » Tue Aug 25, 2015 6:37 am

You can also give a negative value to acceleration
Image Image
B
22
S
13
G
130
Posts: 869
Reputation: 67,816


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests