Character force teleports/respawns at origin after simple camera tween

Hello all!
I randomly found this bug while coding a cutscene for a friend today. It was interesting so I decided to reproduce it in an empty baseplate and… it got stranger.

So first, a description:
When the camera is in scriptable mode, and tweened to look vertically down on a part, the player’s character is teleported to 0,0,0 (the origin) and then appears to loop respawn there.
https://i.gyazo.com/a0226fedb3b8296ff03b6f99242b5bb3.mp4

This happens in Roblox Studio and the Roblox Client. I noticed just today but I have no idea how long it has been in the engine. Moving your character after respawning at the origin seems to break the cycle and everything returns to normal.

I’ve attached a Roblox Place file for reproducing the glitch. It has one part in workspace and one client script to manipulate the camera and produce the bug. For reference, this is the only custom code in the entire place file:


Set the camera to scriptable. Play a tween. Set it back to custom. Quick and sloppy, nothing fancy.
(Setting it back to custom just lets you see the effects of the bug better, it’s not required to create the bug).

I found this on a desktop with modern hardware and can reproduce it on any device I’ve tried (phone, laptop).
Repro File: CameraBug.rbxl (21.6 KB)

This isn’t a super important bug, but it is… interesting? You can band-aid this by adding any amount to the X or Z axis on the tween instead of looking straight down.

Thanks for reading!

4 Likes

I think I debugged something similar once for someone. If you’re making the camera look exactly downwards, this is likely creating a NaN through some implementation detail that gets propagated to the Humanoid through the character controller code (since characters use the camera lookvector to determine which direction to move when you hold W, if it is perfectly downwards some math does not work anymore). Humanoids do some weird reality blinking when you NaN certain properties.

A solution you could implement is to change how you aim the camera. Move it directly above the character, and 0.001 units south and use lookAt so it is not looking directly downwards anymore.

1 Like

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

Please note that filling a bug report does not guarantee that it will be fixed once triaged.

This bug is still being worked on, when there is an update i will pass it on.

2 Likes