top of page
Search

Bump bump bump

  • Writer: Karinett
    Karinett
  • Mar 20
  • 2 min read

Updated: 19 hours ago

Shrooms


Decided to spend some time and fix up the physics on the Mushroom bumper, but also create the 'forward' bumper actor while I'm at it.


Previously, the Mushroom bumper took the Normal Impact on hit and multiplied the X and Y of the given vector by -1 to calculate the opposite direction. I then multiplied this by a Force Multiplier variable and then applied the resulting force as an impulse to the penguin's puck.


However, this caused a lot of problems, especially when hitting multiple bumpers in quick succession, as it would cause the penguin to move faster each time. This resulted in the penguin flying off the board repeatedly.




The solution?


Calculate the speed of the penguin (puck), apply a force multiplier to the speed, and then apply a directional force to it (in this case, the 'opposite' direction of the impact). Then I add a clamp to ensure the top speed of the penguin doesn't spiral out of control, before applying the overall resulting force as an impulse on the penguin (puck). I also added a couple additional nodes to ensure no z forces are being applied as this sometimes knocks the penguin over.



And the result looks like this-- still bouncy, but far more controlled! Also note the new red color!


Forward bumper


As mentioned, there's another type of Bumper in our game -- the Forward bumper. Unlike the Mushrooms, this one only bounces when hit from the front.


So, first things first, I check where the hit came from by using the dot product of the impact normal compared to the forward vector of the Bumper actor.



I then use a similar physics set up as the Mushroom, but instead of bouncing in the opposite direction of the force (like the mushroom does), I simply get the forward vector of the Bumper actor and use that as my directional force. The result looks like this:




Both bumpers will require more tuning to get it to feel really nice, but it's definitely a big improvement to how it behaved previously.


... and that's all for today!

 
 
 

Comentários


bottom of page