02.04.2015, 15:12
Quote:
If your box would be 2x2x2 meters in size, and the box is at coordinates 10, 15, 3 (x, y, z), you could check if the player is in range of the center of the box (10, 15) and 1 meter higher than the position of the box (this would be the top-plane of the box).
For this given box, you check if the player is in range of 10, 15, 4 with a small range (1m for this box since it's only 1 meter from box-center to a side of the box). So the player must be on top of the box for the range-check to trigger. It could still fail if the player is standing at the corner of the box, since a corner is 1.41m from the center. You could still use a range of 1.41m to include the corners of the box. |
Thanks for the tutorial.