Hey, I’m looking for advice -
I’m wanting to create a Galaxy map; this will work by the GUI scrolling / moving to the direction the mouse is pushing although I have no clue where to start with this.
Does anyone have any advice as to how I can achieve this?
do a repeat loop and instead of by mousex and mousey do something like this
Mouse.Move:Connect(function()
if inBoundary then
local map = Map["Content"]--Good work of content like that, their going to add something there
local Direction = Mouse = map.AbsolutePosition
map.CanvasPosition = Vector2.new(map.CanvasPosition.X + Direction.X, map.CanvasPosition.Y + Direction.Y)
end
end)
local Dampener = 5
Mouse.Move:Connect(function()
if not inBoundary then --We dont want them to not be able to click on anything
local map = Map["Content"]--Good work of content like that, their going to add something there
local Direction = (Mouse - map.AbsolutePosition) / Dampener
--Add dampener so they don't speedymgeedy
map.CanvasPosition = Vector2.new(map.CanvasPosition.X + Direction.X, map.CanvasPosition.Y + Direction.Y)
end
end)
local Dampener = 5
local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function()
if inBoundary then --We dont want them to not be able to click on anything
local map = Map["Content"]--Good work of content like that, their going to add something there
local Direction = (Vector2.new(Mouse.X, Mouse.Y) - map.AbsolutePosition) / Dampener
--Add dampener so they don't speedymgeedy
map.CanvasPosition = Vector2.new(map.CanvasPosition.X + Direction.X, map.CanvasPosition.Y + Direction.Y)
end
end)
The reason i made it so if it was out of the boundry was because if your scrolling gui has clickable stuff its going to be hard to click that if the map is moving all over the place… Also you should use RenderStepped as an activation instead of mouse.Move (I forgot to change it yesterday). Apply the dampener a bit more aswell…