Part that wont rotate

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
image
and this is the tower after being placed, with the range circle correctly on the ground
image

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

1 Like

I suggest you try to change the Orientation by adding it onto the CFrame line above with CFrame.Angles() instead of changing the Orientation directly.

2 Likes

instead of making its cframe like that try to instead make it like this

tower.PrimaryPart.CFrame * CFrame.new(0,-3,0) * CFrame.Angles(math.rad(90),0,0)

im not sure if the math.rad(90) should be in the x spot but just switch them around if thats the wrong spot cause i usually get it wrong aswell i just change it from x to y to z until i get the right angle :sob: hope its what you were looking for

it still wont rotate, but the range circle for the tower after placing will change