I’m having great success learning Python with the BGE as my first language. The learning process has been really enlightening. I’m currently just struggling to get my head round one thing:
I only want my character to be able to jump when it’s colliding with another object below it.
Get the coordinates of the character. Get the coordinates of the collision. If the collision is below the character then enable jump.
There doesn’t seem to be a way of obtaining collision coordinates.
Alternative approaches that nearly work:
Obtaining the character coordinates and the collided object coordinates. If the player is above the collided object then enable jump. This gets the collided object coordinates from the object origin, so any terrain that isn’t flat doesn’t work.
Using rays I was able to use an axis for collision detection. This worked very well, though the only problem is it was detected on a one dimensional line from the center. So if the character was slightly over a ledge with the center over as well, there wasn’t a collision.
Applying a material to the top of all collideable terrain and using material rather than property collision detection. This would work, but it’s too clunky and not flexible enough.
Any help would be great!