PGD Home

P0-A6: Part 718: Debugging, Modelling, Physics

by on Apr.05, 2020, under Art and Designs, P-0, P0_A6, Software and Games, Spiritus Astrum

I believe I have mostly fixed the stair climbing physics changes.

I actually used a combination of techniques. First, I used a trigger to disable the gravity while the player is on the stairs, this prevents the player from sliding back down the stair ramp, and allows them to easily climb the ramp (since there’s no gravity preventing them).

Then, I used raycasting to keep the player aligned with the stair surface (since, without gravity, the player would float in midair).

This worked reasonably well, but there was a problem: without gravity, there was no friction, so when the player would stop moving their character, the character would glide or float some distance before finally stopping. This was awkward and unrealistic.

So, to solve this, I simply added back in gravity, but this time, I changed the gravity vector to the inverse of the surface normal that the player was walking over.

So, essentially, instead of gravity pulling the player straight down, it was pushing the player into the surface they were walking on.

Both of these solutions together seemed to work well. I also made sure to use local space vectors, so that this system works regardless of the orientation of the staircase, and the player, which was necessary for a game like mine, where the up vector is arbitrary.

I have also mostly finished the modelling for the missile base, I just need to unwrap and texture it.


Comments are closed.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!