# Misc (can't fit anywhere else)

Relying on Event:Wait() is dangerous as there's a non-zero chance that it can hang forever. It's safer to just use a while loop with a task.wait() instead

ContentProvider.RequestQueueSize goes up once your character connects

If you have the infinite loading cursor bug, you can fix it by setting a ValueObject in Studio, this fixes the issue for some reason.\
Link to bug in case it gets fixed: <https://devforum.roblox.com/t/blue-spinning-loading-cursor-consistently-getting-stuck-when-play-testing/1988569/11>

Pressing ALT+C after selecting a join will select both of its attachments.

A newly created server will run in its first frame all the server scripts before the client connects. You can abuse this to make last minute changes to the wordmodel, such as moving debug instances before any client can see it, or moving contents into replicatedfirst.

task.spawn is immediate,\
coroutine is immediate,\
spawn is after the thread exits,\
task.defer is on the next Heartbeat step (wait until lua code execution has finished + engine code)\
task.wait is on the next Heartbeat step<br>

The Mouse for PC and Mobile users is always raycasting from wherever it currently is located. If you can, read from the Mouse raycast (ex: Mouse.Hit) and changing its properties instead of using your own raycast system as there's already resources dedicated to this process

You can find textures that come with Studio in this directory:\
C:\Users\\\[Computer]\AppData\Local\Roblox\Versions\\\[version]\content\textures

You can use the built-in textures with this path rbxasset://textures/..., this will look up in the textures folder.

Roblox Unicode has these emojis for text:\
\u{E001} <- premium emoji\
\u{E002} <- robux emoji

How to easily weld in place with code: (also works with Motor6D)

```lua
local function WeldInPlace(Src: BasePart, Dest: BasePart): Weld
	local Weld = Instance.new("Weld")
	Weld.Parent = Src
	Weld.C0 = Src.CFrame:ToObjectSpace(Dest.CFrame)
	Weld.Part0 = Src
	Weld.Part1 = Dest
	return Weld
end
WeldInPlace(game.Selection:Get()[1], game.Selection:Get()[2])
```

You can change the Script Timeout Length in the settings here:\
settings().Studio.ScriptTimeoutLength\
However! This has no effect on live games, it will still use the default value.

You can load any accessory at runtime like so:

```lua
local InsertService = game:GetService("InsertService")
local accessory = InsertService:LoadAsset(13279054727):GetChildren()[1];
accessory.Parent = game.ReplicatedFirst
```

All possible thumbnails you can load for free with just a URL:\
rbxthumb://type=AvatarHeadShot\&id=USERIDGOESHERE\&w=150\&h=150

<pre><code><strong>Type:               Supported Sizes:
</strong>"Asset"             150x150, 420x420
"Avatar"            100x100, 352x352, 720x720
"AvatarHeadShot"    48x48,   60x60,   150x150
"BadgeIcon"         150x150
"BundleThumbnail"   150x150, 420x420
"GameIcon"          50x50,   150x150
"GamePass"          150x150
"GroupIcon"         150x150, 420x420
"Outfit"            150x150, 420x420
</code></pre>

Modifying the Cameras Focus property can be used as a means to bypass how the game loads areas for situations like StreamingEnabled or LOD popping.

You can check if the viewport gets resized (PC only) by checking this parameter in the Camera:

```lua
workspace.CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
	print("New size:", workspace.CurrentCamera.ViewportSize)
end)
```

Cool Glass Distortion effect using roblox bug:\
<https://devforum.roblox.com/t/hidden-glass-distortion-effect-with-reflections-tutorial/2338789>

1. only the owner of an assembly's root part is considered for local simulations
2. so if you weld a locally-owned part to a server assembly with a root priority of 127, the client will start simulating it and it'll temporarily break the server->client relationship

Hack by Tinarg :)

When Terrain has multiple textures in one triangle, it will look at the Y component of the materials normal map to figure out which diffuse texture should be shown
