Trying to make a halo float without anchoring it

Hello! I’ve been trying to make this script that basically gives you a Halo, similar as in ToH;
I’m trying to make it stay up on the air without anchoring it (Because then it wouldn’t move with the player) and I have been trying many other scripts, which broke it.

Current script: (Which works, but doesn’t keep the halo on the air.)

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")

local Halos = ServerStorage:WaitForChild("Halos")
local Halo = Halos:WaitForChild("TestingHalo")
local HaloEvent = ReplicatedStorage:WaitForChild("HaloEvent")

HaloEvent.OnServerEvent:Connect(function(Player)
	if Player.Character then
		Halo.PrimaryPart = Halo:FindFirstChild("Handle")

			Halo:Clone().Parent = Player.Character
			Halo.Handle.Position = Player.Character.Head.Position + Vector3.new(0, 2, 0)
		    Halo.Handle.Anchored = false
		local weld = Instance.new("Weld")
		weld.Part0 = Halo.Handle
		weld.Part1 = Player.Character.Head
		local weld = Instance.new("Weld")
		weld.Part0 = Halo.Handle
		weld.Part1 = Player.Character.Head
		local weld = Instance.new("Weld")
		weld.Part0 = Halo.Handle
		weld.Part1 = Player.Character.Head
	else
		print("Unable to find "..Player.Name.."'s head")
	end
end)

I’d love to get some help. Thanks! :smile:

1 Like

Try unanchoring the halo after creating the weld.

1 Like

I would suggest you to not anchor it, but just position it instantly before welding it.

But it wouldn’t move with the player, and the

Halo.Handle.Position = Player.Character.Head.Position + Vector3.new(0, 2, 0)

part already positions it right before it welds, or do I add a wait() and then weld it?

I would say either loop the position, which adds a clean type of “tween” to it, or you can try and fix the issue with a weld.

I would suggest a loop since it’s smoother and really easy to make.

Try adding wait(), if that doesn’t work then you should try positioning it exactly above the head when the player spawns and then insert the weld.

here is a script that I have modified a bit I have not yet tested but I think it’s good :wink:

local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local ServerStorage = game:GetService(“ServerStorage”)

local Halos = ServerStorage:WaitForChild(“Halos”)
local Halo = Halos:WaitForChild(“TestingHalo”)
local HaloEvent = ReplicatedStorage:WaitForChild(“HaloEvent”)

HaloEvent.OnServerEvent:Connect(function(Player)
if Player.Character then
Halo.PrimaryPart = Halo:FindFirstChild(“Handle”)

	local newHalo = Halo:Clone()
	newHalo.Handle.Anchored = true
	newHalo.Parent = Player.Character
	newHalo.Handle.Position = Player.Character.Head.Position + Vector3.new(0, 2, 0)
	local weld = Instance.new("WeldConstraint")
	weld.Parent = newHalo
	weld.Part0 = newHalo
	weld.Part1 = Player.Character.Head
	
end

end)

if it does not work or the halo falls check if the Anchored is true because I just noticed 5 seconds ago and I just remodeled it

Can you not just use an Accessory?:

Tried many times, failed every single time I tried.

Works perfectly, one problem is that it doesn’t move with the player.

Maybe show us your Accessory code that failed–It ought to be easier than reinventing the wheel,
as you seem to be trying to do.

do you want to get this?

Yes, the moving halo part is the exact thing I need.

here is the script.
I tried to convert myself like the one you presented

local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local ServerStorage = game:GetService(“ServerStorage”)

local Halos = ServerStorage:WaitForChild(“Halos”)
local Halo = Halos:WaitForChild(“TestingHalo”)
local HaloEvent = ReplicatedStorage:WaitForChild(“HaloEvent”)

HaloEvent.OnServerEvent:Connect(function(Player)
if Player.Character then
Halo.PrimaryPart = Halo:FindFirstChild(“Handle”)

	local newHalo = Halo:Clone()
	newHalo.Handle.Anchored = true
	newHalo.Parent = Player.Character
	newHalo.Handle.Position = Player.Character.Head.Position + Vector3.new(0, 2, 0)
	local weld = Instance.new("WeldConstraint")
	weld.Parent = newHalo
	weld.Part0 = newHalo
	weld.Part1 = Player.Character.Head
	
	newHalo.Handle.Anchored = false
end

end)

Is it the same? It doesn’t move, if you want to talk about this on discord (so it doesn’t flood this, friend me there; hexagon#4416)

yes but you could just create a copy of the game so that i fix it to you “it doesn’t bother me i have nothing to do” more if you don’t want to share your game “i understand” will have to show me its contents? because I can’t really connect the scriptable links :confused:

Basically I would take time to know how the events of your game are doing?

otherwise you can share me by discord if you don’t want to put it here

Hm, sure, I can give you the copy of the game, where can I give you the game copy though?

(Oh, by discord? Friend me there.)

name and code of the discord “30 tags charactes for a message -_-”