im making a tower defense game, and when you click on a tower to place, a green placeholder of it will appear on your mouse. i tried to give the placeholder a range circle, however the circle wont rotate no matter what i do
this is the placeholder with its range
and this is the tower after being placed, with the range circle correctly on the ground
this is the code that makes the circle
local function createRangecircle(tower,placerholder)
local range = tower.Configuration.range.Value
local height = (tower.PrimaryPart.Size.Y/2) + tower["Left Leg"].Size.Y
local offset = CFrame.new(0,-height,0)
local p = Instance.new("Part")
p.Name = "range"
p.Shape = Enum.PartType.Cylinder
p.Transparency = .4
p.Material = Enum.Material.Neon
p.Color = Color3.fromRGB(60,120,255)
p.Size =Vector3.new(.4,range*2,range*2)
p.BottomSurface = Enum.SurfaceType.Smooth
p.TopSurface = Enum.SurfaceType.Smooth
p.CFrame = tower.PrimaryPart.CFrame * offset
p.Orientation = Vector3.new(0,0,90)
p.CanCollide = false
if placerholder then
p.Anchored = false
local weld = Instance.new("Weld")
weld.Part0 = p
weld.Part1 = tower.PrimaryPart
weld.Parent = p
p.Parent = tower
else
p.Anchored = true
p.Parent = workspace.Camera
end
end