This is more of a Math question but since it uses construct features I figured I would ask it here instead of Stack Overflow...
I've built a variation on the 3d platformer example project.
It uses a similar dz adjustment system for the player's z-height, allowing them to jump/fall.
From line 38 onwards in the Player event sheet, I set a maximum height for steps, and then, when a player collides with a step, they move up onto it. The problem is, the movement is very rigid and sudden, and not natural at all. For other reasons I cannot interpolate the Z-axis as it is used for bobbing/etc.
How can I modify the player's DZ on line 44, to counter-act gravity and move up exactly four pixels before beginning to fall again?
+ Player: On collision with Platforms
+ Player: DZ = 0
+ System: Platforms.ZElevation + Platforms.ZHeight ≤ Player.ZElevation + StepHeight
+ System: Platforms.ZElevation + Platforms.ZHeight > Player.ZElevation
-> System: Set PlayerOldZ to Player.ZElevation
-> Player: Set Z elevation to Platforms.ZElevation + Platforms.ZHeight
-> Player: Set OnGround to True
Thanks!
Full capx: https://drive.google.com/file/d/1ri4KdhNpJotnZ0uNoLAzYYXpD0r10mJt/view?usp=sharing