What I am trying to create is a mechanic where if the current player hovers over another player’s torso or head their whole body goes transparent to an extent.
I am on track of sort of figuring out the code for this but I have an issue where when I hover over the head of another player it doesn’t work at all and when I hover over the torso of another player it only works when I hover in the gaps between the arm and torso.
This video shows the problem (Excuse the long loading I am on HP laptop…) and what I am trying to achieve.
At first, I thought it was the clothes but I removed the clothes and the problem still continued. I also tried checking if something was in front of the torso by looking through rigs and there isn’t anything.
I have a more complex script to achieve what I am trying to do but for simplicity purposes when showing you guys the problem, I made a simple code that gets across the idea of what I am trying to do and what I have been doing in my other scripts.
Example of Code:
local avatar = workspace.myavatar
local clickdetect = script.Parent
local body = {
avatar.Head,
avatar.LeftFoot,
avatar.LeftHand,
avatar.LeftLowerArm,
avatar.LeftLowerLeg,
avatar.LeftUpperArm,
avatar.LeftUpperLeg,
avatar.LowerTorso,
avatar.RightFoot,
avatar.RightHand,
avatar.RightLowerArm,
avatar.RightLowerLeg,
avatar.RightUpperArm,
avatar.RightUpperLeg,
avatar.UpperTorso,
}
clickdetect.MouseHoverEnter:Connect(function()
for _, v in body do
v.Transparency = 0.6
end
end)
clickdetect.MouseHoverLeave:Connect(function()
for _, v in body do
v.Transparency = 0
end
end)
NOTE: I put the click detector in the UpperTorso before I tested so I didn’t need to do the coding for that.
Honestly baffled as to why it isn’t working; I’m kinda afraid that this isn’t possible on Roblox at all because if it isn’t, my whole mechanic is out the window along with my days of scripting…
Thank you for your help!