If you’ve ever played League of Legends you’ll know that when you put your mouse to the edges of the screen it moves the camera, I’m trying to achieve a similar effect as seen in that game using mouseentered, loops, and a part, the camera follows the part.
First, I have a part that follows the character, it doesn’t matter yet and the camerapart that’s being used for the smooth camera effect follows the character right now.
Second, when I hover over these GUIs I want the camera to move in one direction, left of the screen goes left, top of the screen goes up, so on.
It’s working sorta but despite me not changing the CFrame values, the part is moving in different directions, like this:
Launch 1:
Gyazo
Launch 2:
Gyazo
These two launches are right after another, I thought maybe I had to let the camera and MouseFollowPart settle for a minute but that wasn’t it, same issue.
Here’s the localscript under that top GUI.
script.Parent.MouseEnter:Connect(function()
script.Parent.IsMouseHere.Value = true
end)
script.Parent.MouseLeave:Connect(function()
script.Parent.IsMouseHere.Value = false
end)
local Player = game.Players.LocalPlayer
local MFP = Player.Character:WaitForChild("MouseFollowPart")
script.Parent.IsMouseHere:GetPropertyChangedSignal("Value"):Connect(function()
Player.PlayerScripts.CameraScript.IsFollowingMouse.Value = true
Player.Character:FindFirstChild("MouseFollowPart").PositionUpdater.Enabled = false
repeat
MFP.CFrame = MFP.CFrame * CFrame.new(0,0,math.rad(200))
wait(.01)
until script.Parent.IsMouseHere.Value == false
end)
The camera isn’t at fault here it’s the MouseFollowPart, the Camera follows the part just fine, I disable the position updater for the part on mouseenter, there’s nothing else changing the CFrame of the part, does anyone know what’s happening here?