Hey. There is a square locked on players mouse and it should make red every npc when touched. But it’s not working as expected. Sorry for my english but i will add a video too. Is there any alternative to touched event or am i doing something wrong ?
Here is my code :
RunService.RenderStepped:Connect(function(step)
squareReal.Position = Vector3.new(mouse.Hit.p.X,0,mouse.Hit.p.Z)
squareVisual.Position = Vector3.new(mouse.Hit.p.X,0,mouse.Hit.p.Z)
end
squareReal.Touched:Connect(function(part)
if part.Parent.Parent.Name == "NPCs" then
if part:IsA("MeshPart") then
part.TextureID = ""
end
end
end)
squareReal.TouchEnded:Connect(function(part)
if part.Parent.Parent.Name == "NPCs" then
if part:IsA("MeshPart") then
part.TextureID = part.Texture.Value
end
end
end)
robloxapp-20201106-0109256.wmv (3.5 MB)