Is there any way to measure the space between the floor and the player?

Dodobee

Member
I'm wondering if there's an if statement that you can use to check if the distance between the player and the floor is a certain number?
 
a mobj's z coordinate holds their z position in the world
a mobj's floorz field holds what's the closest floor from their point of view - that is, the first thing below them that would stop their movement (that is not an object? i forgot)

Assuming the variable mobj exists and has a mobj, the expression
mobj.z - mobj.floorz
should give you the distance between mobj and floor.

You can get the mobj a player is controlling with player.mobj (assuming the variable player exists and has a player)
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top