Getting a bullet object's angle of reflection

0 favourites
  • 3 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Is there a way to get the angle of reflection value from an object with the bullet behavior when it collides with another object?

    I was using the bullet bounce-off-solids behavior for an object, but I would like to pause and play a short animation when the object collides with a wall before it bounces off (it's a little grip-the-wall-and-then-launch-off animation).

    I tried turning off the bounce off solids and using the bounce action after playing my animation, but it sends the object in an unexpected direction (instead of reflecting off the surface, it bounces back along the vector that it entered), perhaps because it no longer has the original vector?

    I was hoping to get the angle of reflection on the initial collision with the object, save that, then set the sprite's angle of motion to that value when the intermediary animation is finished.

    Can I get this value? Other suggestions for how to do this?

    Here's a quick isolated test case that's fairly representative of the issue (press mouse buttons to rotate the thing).

    http://storage.wertle.com/construct2/AngleProblems.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Set bounce of solid to yes and try this:

    <img src="https://dl.dropboxusercontent.com/u/48563442/bounce-grab.jpg" border="0" />

  • Works like a charm, thank you!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)