The attack circle does not move smoothly

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?

1 Like

did u forget to give the weld a parent?
Else use try using game:GetService("RunService").RenderStepped:Connect(updateCirclePosition)

1 Like

When i add parent like:

local weld = Instance.new("WeldConstraint")
weld.Part0 = circleModel
weld.Part1 = hummanRootPart
weld.Parent = circleModel

my character stack on respawn, wierd. I can only jumb, not move.

But this game:GetService("RunService").RenderStepped:Connect(updateCirclePosition) work smoothly :slight_smile:

Now I’m ready to try this on server side so that other players can see it. Thank for help.

1 Like

To use the weld option, make sure the circle has masless checked on and vancollide false and unanchored

1 Like

Wow :slight_smile: This two options make circle move perfectly, thanks.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.