I’m trying to get my head straight on a few things that have me tied up in knots a little after moving over from Clickteam Fusion. I’m hoping I’m just missing simple things and am also not knowing the right wording for what I’m trying to find :^)
I’m working with the platform behaviour, and the best way I can describe what I’m trying to do is, imagine the player has a jet pack!
Once the player is airborne, you can press a button to fire the jetpack thruster and use left and right to move them, with a fair amount of floaty inertia.
This is all absolutely fine and works well. But where I’m falling down a is, collisions with the scenery!
What I’d like to achieve is, when you are flying, colliding with walls / ceiling will bounce you off. Not a fully elastic bounce, more like some of the impact velocity is being absorbed.
My first thought was trying to record the x and y velocity at the point of impact and using these values to bounce you off, remove a bit of the actual impact velocity to make the impact feel better and also use it to subtract from a health meter of sorts, but I immediately hit a problem which was, I assume the platform behaviour has already seen the collision and stopped my player before my On Collision event fires, asking how fast you’re going (as it always returned 0).
But then I figured this might not work very well even if I could get the values I wanted, for angled surfaces (probably mostly 45 degrees and 30 degrees as the game will have tile-based scenery). Working out the appropriate bounce angle out could get messy.
I had read somewhere that maybe the bullet behaviour would be good for handling the bounces, and a quick experiment with just setting its speed and acceleration to 0, Gravity to 1000, setting Bounce of solids to true and removing Set angle, yielded quite decent results. The new problem(s) here are that I don’t see any obvious way to affect how much bounce actually happens and also, how I would possibly combine this with the platform behaviour or even make the bullet player controllable!
I might just be going off on entirely the wrong tangent so I thought before I buried myself in this, I’d ask in here and see if anyone could point me in the right direction :^)