I can’t figure out how to make the mouse icon rotate with tweens!
So basically I want my cursor to rotate and fade in when a tool is equipped. Tried using tweens and tried rotating an image label, no luck.
Mouse_Icon = "rbxassetid://1587962705"
Tool = script.Parent
Mouse = nil
function UpdateIcon()
if Mouse then
Mouse.Icon = Tool.Enabled and Mouse_Icon
end
end
function OnEquipped(ToolMouse)
Mouse = ToolMouse
UpdateIcon()
end
function OnChanged(Property)
if Property == "Enabled" then
UpdateIcon()
end
end
Tool.Equipped:Connect(OnEquipped)
Tool.Changed:Connect(OnChanged)
This is my current script right now. A LocalScript stored inside my tool.
You can’t rotate or re-position the mouse icon through the Mouse instance. To achieve what you want, you will need to make the real mouse invisible, and then create a GUI that follows the mouse’s location, and then do the tween/rotate effects to the GUI.
I used a while true do loop to make a frame go to my mouse but it’s really choppy. How do I fix this?
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
while true do
ㅤwait()
ㅤscript.Parent.Position = UDim2.new(0, ((mouse.X)-0), 0, ((mouse.Y)-0))
end