null
nil
-
[RBX1]
0
0
0
0
1
0
0
0
1
0
0
0
1
Workspace
[null]
-
[null]
0
0
5
5
1
0
-0
-0
0.707106829
0.707106829
0
-0.707106829
0.707106829
70
0
0
0
1
0
0
0
1
0
0
0
1
Camera
-
true
-0.5
0.5
0
0
-0.5
0.5
4
0
194
-2
126
-2
1
0
0
0
1
0
0
0
1
true
0.5
0.300000012
-0.5
0.5
0
0
-0.5
0.5
0
0
true
256
Terrain
0
-0.5
0.5
0
0
0
0
0
-0.5
0.5
3
0
0
0
0
0
2044
252
2044
-
StarterPack
-
StarterGui
true
-
0
10
1
Soundscape
1
-
CollectionService
-
PhysicsService
-
BadgeService
-
Geometry
-
RenderHooksService
-
SocialService
-
1000
Debris
-
Instance
-
Instance
-
CookiesService
-
Teleport Service
-
true
Players
-
Selection
-
4286611584
1
4278190080
4278190080
4290822336
100000
0
41.7332993
Lighting
4289967032
14:00:00
-
ChangeHistoryService
-
true
true
true
true
TestService
10
-
false
Script
-- print 'No Terrain'
pt1 = Vector3.new(-1028,-4,-1028)
pt2 = Vector3.new(-1020,4,-1020)
-- print(Workspace:FindPartOnRay(Ray.new(pt1, (pt2-pt1).unit)))
testHit, testLocation = Workspace:FindPartOnRay(Ray.new(pt1, (pt2-pt1).unit))
RBX_CHECK_EQUAL(testHit, nil)
RBX_CHECK_EQUAL(testLocation, Vector3.new(-1027.42261, -3.42264986, -1027.42261))
-- print(Workspace:FindPartOnRay(Ray.new(pt2, (pt1-pt2).unit)))
testHit2, testLocation2 = Workspace:FindPartOnRay(Ray.new(pt2, (pt1-pt2).unit))
RBX_CHECK_EQUAL(testHit2, nil)
RBX_CHECK_EQUAL(testLocation2, Vector3.new(-1020.57733, 3.42264986, -1020.57733))
-- print 'Set Terrain'
game.Workspace.Terrain:SetCell(1,0,1, 1,0,0)
testa, testb, testc = game.Workspace.Terrain:GetCell(1,0,1)
-- print(testa)
-- print(testb)
-- print(testc)
RBX_CHECK_EQUAL(testa, Enum.CellMaterial.Grass)
RBX_CHECK_EQUAL(testb, Enum.CellBlock.Solid)
RBX_CHECK_EQUAL(testc, Enum.CellOrientation.NegZ)
-- print(Workspace:FindPartOnRay(Ray.new(pt1, (pt2-pt1).unit)))
testHit3, testLocation3 = Workspace:FindPartOnRay(Ray.new(pt1, (pt2-pt1).unit))
RBX_CHECK_EQUAL(testHit3, nil)
RBX_CHECK_EQUAL(testLocation3, Vector3.new(-1027.42261, -3.42264986, -1027.42261))
-- print(Workspace:FindPartOnRay(Ray.new(pt2, (pt1-pt2).unit)))
testHit4, testLocation4 = Workspace:FindPartOnRay(Ray.new(pt2, (pt1-pt2).unit))
RBX_CHECK_EQUAL(testHit4, nil)
RBX_CHECK_EQUAL(testLocation4, Vector3.new(-1020.57733, 3.42264986, -1020.57733))
-- print 'Hit Terrain'
-- print(Workspace:FindPartOnRay(Ray.new(Vector3.new(4,0,1), Vector3.new(4,1,4))))
testHit5, testLocation5 = Workspace:FindPartOnRay(Ray.new(Vector3.new(4,0,1), Vector3.new(4,1,4)))
RBX_CHECK_EQUAL(testHit5, Workspace.Terrain)
RBX_CHECK(testLocation5:isClose(Vector3.new(7, 0.75, 4)))