💦 CREATE AND FUCK YOUR OWN AI CUMSLUT 🔥 TRY NOW ♥
Create AI Cumsluts 💦
November 19, 2019

Movement: Physics

The second Movement tutorial is here! We're diving into the world of physics, handing control of our sphere to PhysX while still pushing it toward a desired velocity.

It's also #ThankYouPatrons day. Hey! Thank you all for making it possible to create these tutorials!

Physics (Catlikecoding)

Comments (4)

M
Markus Hofer · February 4, 2020

Just played around with the project for a bit and noticed a few things: * The sphere sticks to walls too much. If I'm trying to pass by the right side of a box and run into the corner, I can't just keep pressing up+right to shimmy past it . * If you run and jump the air acceleration will add to the speed you already gained from running. This feels weird. I'm guessing this is an unintended side-effect of being able to change direction in mid air? btw: I'm not criticizing, I'd just love to see good solutions to these issues! Making a good character controller is hard, yet it's one of the most important things in any game. I'll definitely keep a close eye on this one!

C
Catlike Coding · February 4, 2020

* The velocity component going straight into the wall gets eliminated, absorbed by the collision (assuming the wall is immovable, otherwise it'll get pushed). So if you steer into a wall at 45 degrees you'll slide along at ~70% speed. That's the nature of physics. If you want to maintain maximum speed even when deflected you could project the desired velocity on the wall's contact plane and rescale, like we already do for the ground. You'll have to deal with shenanigans from multiple concurrent contact types though. * Yes, air acceleration applies when not on the ground, always. The weirdness comes from low acceleration. Typically, player acceleration is very high and max speed is reached real quick, so air acceleration doesn't change speed anymore after jumping.

C
Cam N · November 19, 2019

I've just skimmed through this tutorial but I'm so excited to see the things you've covered. I'm sure this will become the "Bible" for any future character movements for me! Will you by chance be covering things like input buffering (pressing jump a few frames before being grounded) and ghost jumping (pressing jump a few frames after leaving an edge)? Those are two things I'd also enjoy seeing your approach too as your solutions are always so thorough and well considered! Looking forward to working through this one and can't wait for the next. Thanks heaps, Jasper!

C
Cam N · November 19, 2019

One suggestion to the formatting: Would it be possible to have a collapsible linked Contents to the headings in each page? They're quite long and it would make repeat trips to the page a much nicer UX and also provide a nice overview. (Keeping it collapsed by default would ensure it didn't take up a heap of space unless you need it)