Dinosaur being destroyed after unanchoring

Hello. So I’ve got a problem where all the Baseparts in the Dino get destroyed after unanchoring.

local function D(Player, Dino)
	local Dino1 = game.ServerStorage.DinoActors[Dino][Dino]:Clone()
	local ThingtoString = tostring(Dino .. 'Handler')
	Dino1.Parent = workspace
	local DinoControl = game.ServerStorage.DinoActors[Dino][ThingtoString]:Clone()
	local TurnHead = game.ServerStorage.DinoActors[Dino].TurnHead:Clone()
	local Animate = game.ServerStorage.DinoActors[Dino].Animate:Clone()
	Animate.Parent = Dino1
	Animate.Disabled = false

	Dino1.Name = Player.Name
	Player.Character = Dino1

	if not Player.PlayerGui:FindFirstChild('Stats') then
		local StatsClone = game.ServerStorage.Stats:Clone()
		StatsClone.Parent = Player.PlayerGui
		Player.PlayerGui.Stats.Enabled = true
		Player.PlayerGui.Stats.Enabled = true

	if Player.Character:FindFirstChild('Saude') then
	if not Player.PlayerGui:FindFirstChild(DinoControl.Name) then
		DinoControl.Parent = Player.PlayerGui
		DinoControl.Disabled = false

	if not Player.Character:FindFirstChild('TurnHead') then
		TurnHead.Parent = Player.Character
		TurnHead.Disabled = false
	Player.Character.PrimaryPart = Player.Character.HumanoidRootPart
	local DSpawns = workspace:WaitForChild('DSpawn'):GetChildren()
	local randomDSpawn = DSpawns[math.random(1, #DSpawns)]
	for i,v in pairs(Teams:GetTeams()) do
		if v.Name == 'Dinosauria' then
			Player.Team = v
			Player.TeamColor = v.TeamColor
	Player.Character:SetPrimaryPartCFrame(randomDSpawn.CFrame * CFrame.new(0,4,0))
		if  Player.PlayerGui:FindFirstChild('Stats') then
		if Player:IsInGroup(5040951) then

The HumanoidRootPart is the one being unanchored. I don’t know why this is happening and would appreciate some help

Edit: All the baseparts are being destroyed. The Humanoid, any local scripts, folders, etc still remain in the player character model. After removing all the other scripts in the game, the problem still persists. The dino model is not the problem as the exakt same one works in another place.


Is it possible that it’s getting moved to a location by another script to under the DestroyFallenParts limit and getting Destroyed?

Are there any forces acting on the dinosaur? e.g. BodyVelocity, VectorForce AlignPosition etc.

Yes, There is a BodyVelocity, but its velocity is set to 0,0,0 and only is edited whenever the character decides to move

Can’t find any script that would that inside the place.

I suspect that is the problem. Sometimes when calculating and unit velocities you will get and error like this

I forgot what that actually means but try printing the Velocity of the BodyVelocity and see the output.

Edit: It means Not A Number [Indefinite]

1 Like

Yea, I did that, its at 0,0,0 the whole time up until the dino is destroyed

Hmm that is very strange indeed. Have you tried duplicating the dinosaur and then unanchoring it?

If both of them disappear then it must be something in the dino that is the problem

1 Like

Yea, the duplicated on disappears. Any idea what in the model would be the problem?

To be completely honest with you I don’t know. Probably the last attempt you could try disabling some scripts to see what the effect is or set some breakpoints to see if anything happens very quickly.

local DSpawns = workspace:WaitForChild('DSpawn'):GetChildren()

Where are the Parts in the Workspace named DSpawn located since it looks like you are spawning the dino at a random one of those locations?

You could maybe try zooming out in the Workspace with the Move tool selecting the HumanoidRootPart and see if it’s getting moved somewhere strange in the window.

1 Like

I am not on a computer so I can not check that :confused:

1 Like

The part where it spawns is where the dino on the video is. It is invisible, anchored and CanCollide is false. As for where the HumanoidRootPart goes, as soon as I unanchor it gets destroyed and unselected.

Try taking that random spawn statement out and just CFrame it at a known location as a check for that part of the script.

1 Like

Nope, it is still getting destroyed