Following system is weird

So i tried to make a player following system but somehow i can’t set the network ownershit because its not in “workspace” while if you print it it says its the child of “workspace”. The Relic also falls out of the world. I tween it, why does it not work?

PS: this is a Script in ServerScriptService.

If you want to try it out, just make a new part in ReplicatedStorage and call it “Relic”

local TweenService 		= game:GetService("TweenService")
local Players 			= game:GetService("Players")
local ReplicatedStorage 	= game:GetService("ReplicatedStorage")


local tweenInfo = TweenInfo.new(0.3)

local Relic = ReplicatedStorage.Relic

local Offset = Vector3.new(3,3,3)

local function playerAdded(player)
	local function characterAdded(character)
		print("A")
		local relic = Relic:Clone()
		
		local Character = player.Character
		local playerPos = Character.HumanoidRootPart.Position
		
		relic.Parent = game:GetService("Workspace")
		print(relic.Parent)
		--relicPrimary:SetNetworkOwner(player)
		
		
		game:GetService("RunService").Stepped:Connect(function()
			TweenService:Create(relic, tweenInfo, {Position = playerPos+Offset}):Play()
			print(relic.Position)
		end)
	
	end
	characterAdded(player.Character or player.CharacterAdded:Wait())
	player.CharacterAdded:Connect(characterAdded)
end

Players.PlayerAdded:Connect(playerAdded)


Tried it out myself, and it seems to “work”. Setting the network owner doesn’t give any error, though tweening unanchored parts isn’t really optimal, it looks very awkward. I’d recommend using something like AlignPosition (and AlignOrientation, if you need to rotate the part/model as well). I would also type task.wait() after setting the model’s parent to avoid errors like this.

1 Like

Thanks i’ll try it out when i can! (Might take me 8 hours)

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