Perfectly inelastic collision

damir0000damir0000 Member, BASIC Posts: 8

Hi!

Is there a way to simulate perfectly inelastic collision in GS?
So the trick is to make 2 actors stick to each other (as opposed to bouncing off) and continue motion as one object.
That new object should obtain velocity and direction which is a result of collision resolve.

Thanks!

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    See my video physics part 3 I show you how to transfer the velocity of one actor to another. You can also constrain the position of one to another with an offset.

  • damir0000damir0000 Member, BASIC Posts: 8

    Thanks, will take a look!

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    great video bro! thanks

  • damir0000damir0000 Member, BASIC Posts: 8

    @ Lost_Oasis_Games ...
    the video itself is really useful, however, it does not resolve the question.
    I'll just add a working file for anyone willing to take a look and try to briefly describe
    the problem.

    Here's the file.

    There are 6 green actors and 1 red actor.
    Green actors are floating around and bounce off the walls and off each other .
    Red actor can only move by jumping on green actors.
    It is achieved by doing a mouse click on any green actor, that's how red actor knows where to jump at.

    Once red actor jumps on green actor it should affect its linear velocity, direction and rotation.
    It's quite similar to perfectly inelastic collision.
    It means that green actor will no longer continue along its way because it'll be interrupted by red actor's velocity and direction.
    Hopefully it makes sense so far!

    I know how to calculate stuff, set equations, etc but GS does not allow any custom code.

    The question is how to achieve the goal with built-in physics.

    Any clue is welcome!

Sign In or Register to comment.