0 Favourites

How do I make a grenade to stop bouncing?

  • Hello, that's my first time posting here.

    I have 2d platformer game, where player throws grenade which is physics + bullet behaviour used.

    Grenade destination is described by position of the mouse.

    When grenade is touching the ground I want it to bounce 1-2-3 times and then to stop bouncing or just immobilize it. Everything is working but...

    The problem is when the grenade bounces more than 5 times - it stats to bounce super fast forever. It never stops.

    Also when player aims the ground it's speed increases greatly.

    I'm trying different types of physic settings like elasticy or friction but there's no difference.

    Forcing grenade to stop by setting bullet speed to 0 doesn't help too.

    Here's the video how it looks like now. http://sendvid.com/5qsvmsrw

    I want it to behave like a grenade known from "Worms armageddon" nades <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> Is it even possible?

  • Here is an example I made for someone else's problem previously - https://www.dropbox.com/s/6cliwidu8f51p ... .capx?dl=0

    It doesn't use physics, but may give you an idea.

  • A few points to note

    -The reason why it appears to be faster when you aim at the ground is because its not directly fighting against the world gravity...

    -Friction only affects objects when they are touching another physics object

    -Elasticity only affects how high objects bounce when hitting the floor.

    -Physics Iterations property will affect behavior like bouncing

    you could also just add a timer that triggers after the first bounce...which then radically adjusts either

    -the physics density for each grenade

    -Linear damping -The rate the object slows down over time while moving ( would suggest this is better)

    and/or

    -turns off the physics after a certain amount of time or even better, triggers its "immovable" Property as long as you test for it being at rest on the Ground

    so it doesn't appear as a glitch

    also i assume the grenade is supposed to explode...Your video doesnt show this but normally a Grenade explodes either on contact or after a delay

    Shouldn't either of these actions cancel out the constant bouncing due to the fact of the grenade destroyed?

  • Also, moving physics objects using other behaviours (like bullet for example) can also cause weird results. It is recommended when using physics to only move the objects by applying forces - and not using "set speed" or "set angle" etc from other behaviours. Usually the option of having two or more behaviours is if you want to move the object sometimes by physics, and other times not.

    ~Sol

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Hey, oosyrag you saved the day! Other responses were also helpful. Thanks guys, grenade works as intended.

    Here's how it looks now: http://sendvid.com/t48nb8yg

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
167 14,484
DMT2005's avatar
DMT2005
Unread sticky
1 Favourites
C2 Games made with CocoonIO
136 89,806
minhcuong's avatar
minhcuong
Unread hot topic
99 10,124
karshinkoff's avatar
karshinkoff