is it possible to approach a block, and see if its height (from my players height, to the top of the block) is under a certain number?

I have some theories.. but they dont work...

basically I have this to start >>
Code:
///.. Checked to see if the player is infront of a block
if(trace_hit!=0){
	if(you==null){//you are a wall
		jump_obstacle=1;
	}
}



now since the block is not an entity, the 'you' pointer doesnt work..

so doing this:
Code:
///.. Checked to see if the player is infront of a block
if(trace_hit!=0){
	if(you==null){//you are a wall
		if(vec_dist(my.z, you.max_z)<25){jump_obstacle=1;}
	}
}



gives me an empty pointer error

any ideas? .. Please laugh

Edit: the reason why I would like this is because my player will check to see if the block infront of him is a valid block to jump up onto.. if its higher than 25, he shouldnt jump.. maybe this is some better info?

Last edited by DevoN; 06/24/11 16:52.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com