Part positioning not working as intended

Hello, I’m currently working on a sort of boss fight, and one of the attacks I’m trying to make isn’t working as intended

Expected outcome: The ‘beams’ that damage the player should go around the arena counter-clockwise, but should also be positioned as such so that they’ll be on the same circumference of the player being targeted. (The arena covers a large circular area, just to note)

Actual outcome: although it’s positioned on the same circumference of the player, it does not go around the arena at all.

local target = nil
for _,v in pairs(game.Workspace:GetDescendants()) do
	if v.Name == "TARGET" then
		target = v
	end
end
task.wait()
game.Workspace.TheMagnitude.Position = Vector3.new(3, target.Parent:FindFirstChild("Torso").Position.Y, 24) -- This simply moves the middle part to be at the same Y level of the targeted player
local distance = (game.Workspace.TheMagnitude.Position - target.Parent:FindFirstChild("Torso").Position).Magnitude -- Gets the distance between the player and the middle part
script.Parent.Parent.nice.CFrame = game.Workspace.TheRotate.CFrame  -- Attempts to move the part to follow the rotation ("nice" is an instance rotated to position where the beam will be)
script.Parent.Position = script.Parent.Parent.nice.Position + Vector3.new(distance,0,0) -- This is what moves the beams to be on the circumference of the player.
game.Workspace.TheRotate.Orientation = game.Workspace.TheRotate.Orientation + Vector3.new(0,7.5,0)

I would greatly appreciate if someone find a solution, because I’m fairly stuck at the moment.

I found a solution on my own after some time, turns out I simply needed to use the LookVector property of CFrame.

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