Posts: 513
Threads: 10
Joined: May 2014
Thanks: 138
Given 89 thank(s) in 75 post(s)
11-14-2015, 04:19 PM
(This post was last modified: 11-14-2015, 08:09 PM by Seadragon91.)
The colon doesn't matter. Looking at the coords, I think the problem is the Y coord.
local bblock = cBoundingBox(Vector3d(-372, 218, 131), Vector3d(-377, 220, 130))
You have 218 and 220, that means the player has to be in the height between 218 and 220, to be trying to walk into the box. Change 218 to 0 for example and test it again.
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
I believe the problem is that the boundingbox expects the coordinates to be sorted. Try switching the Z coordinates. That way the lowest coordinates will be The first parameter, and the higher parameters are the second parameter,
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
First of all you should make the box large, say 50 x 50 x 50 blocks, so that you can actually debug it, see if it works. Only then, after verifying that it works, you should twiddle the coords.
And yes, the cBoundingBox expects the coords to be sorted, the first vector's coords should each be less than the second vector's one.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
The documentation does say "min" and "max" for the coord parameters.
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
Perhaps we should add a Sort function just like in cCuboid?
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
Or the constructor should sort the coords automatically?