Part disappearing for seemingly no reason

Hi there

I have a part that disappears for no reason after about 10 seconds of playing in testing mode. It is there and then disappears for no reason. It’s set to an offset of the camera using this localscript:

local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera

local PropPosition = Character:WaitForChild("PropPosition")

local function OnRenderStepped(dt)
	
	local CameraCFrame = Camera:GetRenderCFrame()
	local RequiredPropPosition = CameraCFrame * CFrame.new(0, 0, -7)
	PropPosition.CFrame = PropPosition.CFrame:Lerp(RequiredPropPosition, TweenService:GetValue(0.7, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut))
	
end

RunService:BindToRenderStep("CharacterSetupRenderStep", Enum.RenderPriority.Input.Value, function(dt)
	OnRenderStepped()
end)

The part has collisions off and is unanchored (both are vital for what I want this part to do - since it is in front of the character, it cannot have collisions and it cannot be anchored as that messes up getting the CFrame of the part which is the entire reason why the part exists (I dont know why but it does).

It is nothing to do with it falling, you would notice that and it very clearly disappears - you can even watch this happen in the Explorer. How do I work around this? Thanks.

1 Like

Hello again. Does the part get removed from the workspace (destroyed) or does its position go thousands of blocks away from where it’s supposed to be?

It’s worth mentioning that if a part’s Y value goes below a specific number which is somewhere in the negatives, it gets automatically destroyed. To test where the part is at any given moment, I recommend using something like this:

Prop:GetPropertyChangedSignal("Position"):Connect(function()
    print(Prop.Position)
end)

Good chance it’s falling below the FallenPartsDestroyHeight limit, which defaults a Y co-ordinate value of -500.

https://developer.roblox.com/en-us/api-reference/property/Workspace/FallenPartsDestroyHeight

Ok so according to this, the part still exists in the intended position after “disappearing” however it is not visible and is not in the workspace (at least in the expected position under character). So Roblox thinks it both does and doesn’t exist at the same time.

FYI, the parent gets turned to “nil” when this happens, in case that helps

Are you changing the parent of the part itself at any point? Might be an issue where the instance you are referencing is nil if so

I am not changing the parent of the part at any point. It’s a routine thing that happens at precisely 10 seconds (I timed it) after pressing the “Play” button in the testing tab. The only thing which stops this happening are

  • Turning on collisions, which is not a good solution as the part is 7 studs in front of the character at all times, so having collisions on would mean players dont have enough movement capablilities.
  • Anchoring the part (This could work - the “messing stuff up” originally was me just being stupid about how the ModuleScript works, however it seems like it’d be unreliable)

To be honest, I’m starting to think this is a Roblox bug. I would report it but unfortunately I’m not a member so I can’t.

1 Like