Skip to content

Commit 1e8cbc0

Browse files
update Open Source Docs from Roblox internal teams
1 parent 04a45cb commit 1e8cbc0

File tree

13 files changed

+256
-87
lines changed

13 files changed

+256
-87
lines changed

content/common/navigation/engine/guides.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ navigation:
430430
path: /cloud-services/cross-server-messaging
431431
- title: Roblox for Unity Developers
432432
path: /unity
433+
- title: Roblox for Unreal Developers
434+
path: /unreal
433435

434436
- heading: Distribute
435437
- title: Overview
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: include
3+
---
4+
5+
Roblox files live in the cloud (although you can export copies), so Roblox Studio provides built-in tools for much more collaborative work: **Team Create** for simultaneous editing, group management, permissions, script drafting, and more. See [Collaboration](projects/collaboration.md).
6+
7+
<Alert severity="info">
8+
Cloud syncing provides further benefits with [packages](projects/assets/packages.md), the Roblox equivalent of {props.package}. Converting an asset or asset hierarchy to a package helps with local reusability, but also with collaboration. When you or your collaborators publish a new version of a package, you can quickly update existing instances of that package within an experience or set them to auto-update.
9+
</Alert>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: include
3+
---
4+
5+
The following Luau code sample demonstrates how to, after a player equips a fishing pole, listen for user input (in this case, the <kbd>E</kbd> key) and call additional functions:
6+
7+
```lua
8+
-- Get the necessary game services
9+
local ContextActionService = game:GetService("ContextActionService")
10+
local ReplicatedStorage = game:GetService("ReplicatedStorage")
11+
12+
-- Get a module script from ReplicatedStorage that returns a single function
13+
local performSomeAction = require(ReplicatedStorage.performSomeAction)
14+
15+
-- Assumes that this script is a child of the fishing pole
16+
local fishingPole = script.Parent
17+
local ACTION_CAST = "Cast"
18+
19+
-- Check that the key is down, then call another function
20+
local function castLine(_actionName, inputState, _inputObject)
21+
if inputState == Enum.UserInputState.Begin then
22+
performSomeAction()
23+
end
24+
end
25+
26+
-- Only enable the action when the player equips the fishing pole
27+
fishingPole.Equipped:Connect(function()
28+
ContextActionService:BindAction(ACTION_CAST, castLine, true, Enum.KeyCode.E)
29+
end)
30+
31+
-- Disable the action when the player unequips the fishing pole
32+
fishingPole.Unequipped:Connect(function()
33+
ContextActionService:UnbindAction(ACTION_CAST)
34+
end)
35+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: include
3+
---
4+
5+
Roblox experiences are multiplayer by default, so Roblox Studio includes many different storage locations with specific behaviors. For example, a script might run when you put it in `Class.ReplicatedStorage`, but not when you put it into `Class.StarterPlayerScripts`. For more information, see [Client-Server Runtime](projects/client-server.md) and [Object Organization](projects/data-model#object-organization.md).
6+
7+
Location | Description
8+
:--- | :---
9+
Workspace | Represents the game world and contains all parts, models, and other objects in the game. You can put scripts into the Workspace, but only server scripts and module scripts run when parented to it. This location works well for scripts that control object behavior, since they can attach directly to the object.
10+
ReplicatedStorage | Contains objects that are replicated to both the client and the server, including scripts. This location is ideal for scripts that share data or functionality between the two, such as game settings, player data, and events.
11+
ServerScriptService | Contains server scripts, including module scripts. This location is ideal for scripts that need to access server-side functionality or objects, such as game logic, data storage, and AI behaviors.
12+
ServerStorage | Contains server-side objects and settings. This location is ideal for large objects that don't need to be immediately replicated to clients when they join an experience.
13+
StarterPlayer | Contains player-related objects and settings. This location is primarily used for setting up player properties and initializations. Client scripts can run from this location, including module scripts. This location is ideal for scripts that set up player-specific features, such as player models, starting inventory, and camera settings. Of particular note, `StarterCharacterScripts` and `StarterPlayerScripts` are different. For more information, see [Client](projects/data-model.md#client).
14+
StarterGui | Contains GUI elements that the client displays when it loads the game. Client scripts can run from this location, including module scripts. This location is ideal for scripts that modify the game's user interface, such as adding buttons, menus, and pop-ups.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: include
3+
---
4+
5+
Roblox experiences support three different types of Luau scripts:
6+
7+
- Client scripts
8+
9+
These scripts run on the client, and the server has no visibility into their behavior. For legacy reasons, these scripts can take the form of `LocalScripts` or `Scripts` with a `Class.BaseScript.RunContext|RunContext` value of `Client`. Client scripts typically live in `Class.ReplicatedStorage`, `Class.StarterPlayerScripts`, or `Class.StarterCharacterScripts`.
10+
11+
- Server scripts
12+
13+
These scripts run on the server, and the client has no visibility into their behavior. Server scripts have a `RunContext` value of `Server` and typically live in `Class.ServerScriptService`, the contents of which are not replicated to the game client.
14+
15+
- Module scripts
16+
17+
These scripts are reusable pieces of code that return exactly one value, typically a function or table (or a table of functions). Rather than duplicating code in client and server scripts, use module scripts to share code and data between the two. Module scripts often live in `Class.ReplicatedStorage`, but can live elsewhere if you want to share code between scripts on the same side of the client-server boundary.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: include
3+
---
4+
5+
{props.engine}'s transforms and Roblox's `Datatype.CFrame|CFrames` serve similar purposes in representing 3D transformations of objects:
6+
7+
- Both transforms and `CFrames` represent the position and rotation of an object in 3D space. Transforms include scale, whereas Roblox uses a `Class.BasePart.Size` property that isn't part of the `CFrame`.
8+
- Both support multiplication (i.e. composition) for complex transformations and have built-in methods for other manipulations.

0 commit comments

Comments
 (0)