I've set up this simple plugin, and what it should do is smooth a radius of terrain around where the mouse is pointed at. It print 'Click', but doesn't smooth.
local plugin = PluginManager():CreatePlugin()
local toolbar = plugin:CreateToolbar("Hello World Plugin")
local terrain = Game.Workspace.Terrain
local smoothButton = toolbar:CreateButton(
"Smooth",
"Use this to smooth an area of terrain",
"SmoothIcon.png"
)
smoothButton.Click:connect(function()
plugin:Activate(true)
local mouse=plugin:GetMouse()
mouse.Button1Down:connect(function()
local mosPos = mouse.Hit
local origin = terrain:WorldToCell(mosPos.p)
local Radius = 4
local region = Region3int16.new(Vector3int16.new(Vector3.new(-Radius,-Radius,-Radius) + mosPos.p), Vector3int16.new(Vector3.new(Radius,Radius,Radius) + mosPos.p))
terrain:AutowedgeCells(region)
print('Click')
end)
end)

2 comments
Oh yeah, that explains it all actually. I meant to put origin instead of mosPos.p in the Region3Int16. Thanks!
Well it's still broken but I think I know where to go from here. Thanks a ton.