-
What do you want to achieve?
I have a NPC that uses magnitude to see if a player is within range. I want the player to be able to click on the NPC and see the range -
What is the issue?
I don’t know how I would create a circle via parts.
Hi!
local DefinedMag = .. -- Define magnitude yourself
local NewCircle = Instance.new("Part")
NewCircle.Shape = Enum.PartType.Cylinder
NewCircle.Orientation = Vector3.new(0,0,90)
NewCircle.Size = Vector3.new(2,DefinedMag*2,DefinedMag*2) -- Since we've rotatated the cylinder, to make it work as a circle, scale the part as follows: Y, X, Z instead of X, Y, Z. We know that magnitude in other words is radius, so we just do radius*2 which also goes under the word "diameter"
NewCircle:PivotTo(TargetCharacter:GetPivot())
NewCircle.Parent = TargetCharacter
There’s more stuff involved with having the circle keep being attached to the NPC ect.
Circle.Size = Vector3.new(Magnitude, 0.1, Magnitude)
Path “Circle” and “Magnitude”
Also adjust the Vector3 so that it’s flat, not tall.
Make sure that size is Magnitude*2, since magnitude is a radius, when it comes to plane sight of a circle.
1 Like
Oh yeah, thanks man. I forgot my middle school math lol.
--Everything else I said in my first post
Circle.Size = Vector3.new(Magnitude*2, 0.1, Magnitude*2)
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.