Shadow step spells pick a random nearby location to teleport the player to. This is pretty easy to do generally, you just rand the radius x,y. This works well except when dealing with uneven terrain, you could end up high in the air or under the map.
Once I have the X,Y, how can I find where a valid Z-axis is, regardless of if its a mesh/terrain/etc? I’m guessing two ray traces, Z up and down, that intersect with a collision and pick the nearest one?
Also is there any efficient way to trace 360 degrees around the player and only Rand() the X,Y in directions where a collision doesn’t intersect (so a Player can’t shadowstep through walls or outside level bounds)?