I’m currently trying to figure out the way to make a normal mouse cursor, turn into a custom cursor when you are in first person. I know this is probably easy but I just can’t think of a way to detect it.
There is a lot of posts about this already, Changing the mouse cursor for a first-person game.
Please search before asking next time.
I did search for this before posting. That is not what I’m looking for, I already know how to do that, please re-read before making assumptions.
Oh, now I understand. When you are not in first person, its the normal mouse cursor, but when you are in first person, your mouse cursor changes.
Is that what you were looking for?
Yes I am (I need a lot more characters for this to send)
Hi to do this You must find the Magnitude distance between the head and the camera when the
magnitude is 0 or 1 then you know the Person has zoomed in Take this script as an example:
local lplayer = game.Players.LocalPlayer
local Camera = game.Workspace.CurrentCamera
local character = lplayer.Character or lplayer.CharacterAdded:Wait()
local Mouse = lplayer:GetMouse()
while true do
task.wait()
local distance = (character.Head.CFrame.p - Camera.CFrame.p).magnitude
if distance <= 1 then
Mouse.Icon = "Your icon id"
print("changed")
else
print("changed back")
Mouse.Icon = ""
end
end
local Run = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Head = Character:WaitForChild("Head")
local Mouse = Player:GetMouse()
local Camera = workspace.CurrentCamera
local function RenderFrame()
local CameraZoom = (Camera.CFrame.Position - Head.CFrame.Position).Magnitude
if CameraZoom < 1 then
if Mouse.Icon ~= "rbxassetid://163023520" then
Mouse.Icon = "rbxassetid://163023520"
end
else
if Mouse.Icon ~= "" then
Mouse.Icon = ""
end
end
end
Run.RenderStepped:Connect(RenderFrame)
I made use of the dragon image used here as a cursor.
https://developer.roblox.com/en-us/api-reference/property/Mouse/Icon