Teleporting player via HumanoidRootPart.Position causes players to turn invisible/glitch all over the map

This is a bug that I discovered when making a game that had enclosed rooms you could teleport to (this was almost a year ago). Occasionally, when testing, another player would join after I had teleported into a room. When I teleported out, I was invisible to them except for random pieces of me glitching/appearing all over the baseplate. Whenever I came into contact with them, they would often glitch/fling/shoot across the map. I eventually narrowed the issue down after lots of testing & various attempts at repros to the repro I’m posting here. I left the issue untouched until now because teleporting via CFrames appeared to resolve the issue. However, this glitchy behavior is continuing to occur in my game despite the changes I made, so I thought I’d post the repro+bug report in an attempt to resolve said issues (the bug still occurs in the repro after new tests so Roblox has not resolved this issue since I last encountered it).

It appears that merely teleporting the player via the HumanoidRootPart’s Position property is enough to cause this bug (i.e. it doesn’t have to be a teleport into an enclosed room).

Here is the place file (but the place itself should be uncopylocked):
Engine_Bug_Demonstration.rbxl (21.4 KB)
This is the link to the repro:

The steps are as follows for the place I posted:

  • Player A joins the game and teleports into the room.
  • Player B joins the game.
  • Player A comes out of the room and is either extremely glitchy to player B or invisible entirely. Either way, if - player A ever comes into contact with Player B, player A is able to fling and easily push around player B as shown in the videos I shared.

The repro is a simple place with a room + door + spawn and one script:

I shall post the script here because it is short:
local tp_part_a = workspace.TPPartA
local tp_part_b = workspace.TPPartB

tp_part_a.Touched:Connect(function(hit)
	
	local character = hit.Parent
	local humanoid_root_part = character:FindFirstChild("HumanoidRootPart")
	
	if humanoid_root_part then
		humanoid_root_part.Position = tp_part_b.Position + tp_part_b.CFrame.LookVector*5
	end
	
end)

tp_part_b.Touched:Connect(function(hit)

	local character = hit.Parent
	local humanoid_root_part = character:FindFirstChild("HumanoidRootPart")
	
	if humanoid_root_part then
		humanoid_root_part.Position = tp_part_a.Position + tp_part_a.CFrame.LookVector*5
	end
	
end)

Here are videos from both angles of the bug occuring:
https://cdn.discordapp.com/attachments/576410748280897566/716127057666506752/Roblox_2020-05-29_23-12-01.mp4

and

https://cdn.discordapp.com/attachments/576410748280897566/716127616070975518/Roblox_2020-05-29_23-14-30.mp4

20 Likes

Massive bump.

I am in need of this being fixed ASAP. My upcoming game is literally unreleasable right now because of this. When testing with my developers, they report me being invisible, when I really am not in my screen. However, for me, they are invisible.

It seems like their character and tools bug completely, not updating at all.

Strangely enough, when I zoom in to first person mode, they update.

I am literally clueless as there is nothing that could cause this. This is also not a script issue because it never happened before until weeks ago.

This bug makes my game extremely unplayable.

Link: Glacier - Roblox (staff)

Please fix this as soon as possible. I am literally in despair. I don’t know what to do. It breaks the game style completely.

7 Likes

You should be able to fix this issue by changing the CFrame instead of the Position property of the rootpart.

6 Likes

Nope. I use CFrame and the issue still happens.

For more details, I am currently using Streaming Enabled. However, this issue still occurred when I turned it off.
I am completely clueless as to what the issue is.

2 Likes

I also had this start occurring after a period of time with CFrame changes instead of just position changes (as I think I mentioned in the post). I have not done any StreamingEnabled specific testing with my repro, but it does happen for sure with position changes without StreamingEnabled on. However, you added that it happens even without StreamingEnabled on for you, and, because this bug appears to have happened at a specific time instead of a feature change in my game, I can only conclude that this is a Roblox specific bug.

2 Likes

This is definitely a Roblox bug.

People have started reporting this issue for my other public game, which has not been updated in a while and has never had this issue before. (SCP: Roleplay)

Please, focus on this bug. This is game breaking. Extremely disrupting bug.

Here are some examples of the reports I’ve been receiving:


https://cdn.discordapp.com/attachments/691354922645454878/727642572301795408/robloxapp-20200630-1749331.wmv

image

This bug is game breaking. Please. This needs to be a priority.

5 Likes

Do you have reproduction steps or a repro file? I would like to test it too.

1 Like

I’m unable to get reproduction steps. I have tried many different things (even removing accessories etc. to see if it could be somehow related to this ancient constraints and attachments bug), but none were useful.

This issue seems to randomly occur. It some times happens during 100% of the session, some times only “some times”, and some times doesn’t happen at all. I have no idea what could be causing it.

The best shot right now at this is to use the op reproduction file.
https://devforum.roblox.com/uploads/short-url/zJElUnQ2POIihKjNi9ohiWI8ETT.rbxl

3 Likes

After hours trying to figure out this issue in a local studio session, I have finally figured out what the issue was on my end.

This is definitely a roblox bug, and can be reproduced by:
1. Have an Accessory parented to the Character
2. Have a part with a decal inside, with the part being apart of the Accessory
3. At Heartbeat / any sort of loop (haven’t tried just setting once), change the decal’s color or any other property.

By doing this, you will completely break any other characters until you zoom into first person.

4 Likes

We had this exact split-character issue when testing an unreleased StreamingEnabled flag. Is this related? @CorvusCoraxx

Thanks for the clear repro place. @orange451 this is occurring even when the place is not streaming enabled, so it is a different issue.

If I change the teleport from:

local humanoid_root_part = character:FindFirstChild("HumanoidRootPart")
   
   if humanoid_root_part then
   	humanoid_root_part.Position = tp_part_b.Position + tp_part_b.CFrame.LookVector*5
   end

to:

character:SetPrimaryPartCFrame(CFrame.new(tp_part_b.Position + tp_part_b.CFrame.LookVector*5))

the problem seems to go away for me. Is there a reason the Model SetPrimaryPartCFrame method cannot be used?

5 Likes

I guess it could be used, but it’d have to then be set as the new standard.

Ever since I started scripting on Roblox I’ve always heard that setting the HumanoidRootPart’s Position / CFrame is preferred, and even the wiki encourages this: https://developer.roblox.com/en-us/articles/How-to-teleport-within-a-Place

What I’m mostly curious about this situation is why setting just the Root part’s position causes it to fail but SetPrimaryPartCFrame doesn’t.

2 Likes

I just tested using

		humanoid_root_part.CFrame = CFrame.new(tp_part_b.Position + tp_part_b.CFrame.LookVector*5)

instead of

humanoid_root_part.Position = tp_part_b.Position + tp_part_b.CFrame.LookVector*5

and I didn’t see the issue. As the wiki link you shared says:

Teleportation is a term given to the act of moving a group of parts, typically a player’s character, to a certain coordinate. In Roblox, setting the  `Position`  property of a parts would disconnect the part from any other parts connected to it and break the model. Therefore, one cannot use the following to teleport a player because it would disconnect the Torso from the Head. Doh!

1. game.Workspace.Player.Torso.Position = Vector3.new(0, 50, 0)

To correctly teleport a player without killing them, you must use the CFrame property and use the [CFrame](https://developer.roblox.com/articles/Understanding-CFrame) data type instead.

I’m not using the Position property to teleport users and I don’t think MetatableIndex is either. My issue is that, even after resolving this issue by teleporting via CFrame, I’ve noticed that this bug is occuring in my game again at arbitrary points. I have not been able to reduce it down to a repro, but I certainly am not teleporting players via the Position property and have not been for about a year now. I had to rewrite all my code to remove it, after all. I may try the SetPrimaryPartCFrame, but I don’t see how that would be any different than what I already do.

1 Like

You should be making a new thread for this since it is getting quite confusing to follow the thread.

Yes, if you have a repro using CFrame please make a new post about it.

2 Likes

Any update on this? It seems to have happened to me today, players are reporting being invisible to each other (I am CFraming their HumanoidRootPart on the client).

This happens to my players and NPCs. It happens rarely to players’ characters that are teleported using HumanoidRootPart.CFrame and more commonly to zombie NPCs teleported using the same teleport method.

I can never replicate it on my own computer nor can certain people replicate it on their computers. I think it only replicates on older and poorer computers on lower graphics settings. Is there any fix coming?

Example: Invisible zombies

1 Like

image
It seems like that the character on the client side is fine but on the server side the character is floating off somewhere else.

5 Likes

Personally it worked so I think you should put that as solution