about 3 hours
ago -
Crater Creator
-
Direct link
Originally posted by nanobesspark: I meant that if you jump, then at this moment it would be good to check how high the environment allows you to jump. And limit the height of the jump so as not to hit your head on the ceiling and other obstacles.
On a technical level there should be no issue adding that. Do a ray cast from the player’s root bone upwards and see what it hits. All the various block shapes have an accurate enough collision mesh - that’s how you hit your head in the first place. So if the ray collides with a block, and the distance is less than the jump height, then scale the jump animation (like they already do to apply the Parkour skill) in the z dimension accordingly. Precomputing for running jumps could be more complicated but A) your trajectory is deterministic as soon as you leave the ground; and B) if they can do melee weapons that sweep out an arc over time they can handle the trajectory of a jump.
@Goldfish you only need to do this when the player hits the jump key, and it’s not going to worsen input lag. Why? Because the game already does the same thing - ray cast and see what it hits - every time you pull the trigger of a gun. And the fire rate on those gets much higher than the frequency of jumping.
Should they do this? Debatable. There are other things to code. But no way it’s impossible.
Originally posted by Seftak:Originally posted by Dreaming Prince: meanwhile, on the nintendo entertainment system, anno 1986, one can jump small jumps by tapping the button, and one can jump big ass jumps by holding the button a bit longer.They are not to NES level coding yet, only Atari level. 1 button does 1 action and that's it.
If you’re not being facetious… A click and hold mechanic works just fine, as anyone who’s drawn a bow can attest. Again, should they? Meh, maybe. Can they? Yes.