Posts: 513
Threads: 10
Joined: May 2014
Thanks: 0
Given 5 thank(s) in 69 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,621
Threads: 113
Joined: Dec 2011
Thanks: 51
Given 55 thank(s) in 409 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: 175
Joined: Jan 2012
Thanks: 40
Given 156 thank(s) in 838 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: 175
Joined: Jan 2012
Thanks: 40
Given 156 thank(s) in 838 post(s)
The documentation does say "min" and "max" for the coord parameters.
Posts: 4,621
Threads: 113
Joined: Dec 2011
Thanks: 51
Given 55 thank(s) in 409 post(s)
Perhaps we should add a Sort function just like in cCuboid?
Posts: 6,485
Threads: 175
Joined: Jan 2012
Thanks: 40
Given 156 thank(s) in 838 post(s)
Or the constructor should sort the coords automatically?