Hey, I’m trying to create something like a player’s active zone (atack circle). First, I want to visually represent it, and then add interactions if someone enters this zone. I’m trying to draw a circle around the player on the ground with appropriate transparency.
Generally, I attach the circle to the player and update its position. However, what I’ve created is lagging. I’ve tried several methods such as using game:GetService("RunService").Heartbeat:Connect(updateCirclePosition)
, but unfortunately, it still seems like the circle is following me rather than being firmly attached.
Another thing I’ve tried is using WeldConstraint. But I think I might be missing something.
local humanRootPart = script.Parent:WaitForChild("HumanoidRootPart")
local circleModel = script.Parent:WaitForChild("RangeAttackCircle")
circleModel.Parent = humanRootPart
circleModel.Position = Vector3.new(humanRootPart.Position.X, 0.1, humanRootPart.Position.Z)
local weld = Instance.new("WeldConstraint")
weld.Part0 = circleModel
weld.Part1 = humanRootPart
I placed the script and the RangeAttackCircle part in StarterCharacterScripts, and the effect I’m getting is that the circle appears but doesn’t move with me.
Do you have any ideas on how to firmly attach the drawn circle to the player?