Code sample on Region3 page results in infinite yield

The Region3 documentation has a code sample under “Expanding a Region3 to a Grid” which contains an error on line 4. Terrain is not a child of game and will yield infinitely. It should be workspace → Terrain.

local region = Region3.new(Vector3.new(0, 0, -3), Vector3.new(4, 4, 4))
local res = 4
region = region:ExpandToGrid(res)
     
local terrain = game:WaitForChild("Terrain")
terrain:FillRegion(region, 4, Enum.Material.Water)

Output:

local terrain = game:WaitForChild("Terrain")
06:46:53.920 - Infinite yield possible on 'Place1:WaitForChild("Terrain")'
06:46:53.921 - Stack Begin
06:46:53.922 - Script 'local terrain = game:WaitForChild("Terrain")', Line 1
06:46:53.922 - Stack End
7 Likes