Skip to content

Commit 74703ae

Browse files
update Open Source Docs from Roblox internal teams
1 parent e00e4c9 commit 74703ae

File tree

11 files changed

+164
-150
lines changed

11 files changed

+164
-150
lines changed
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

content/en-us/assistant/guide.md

Lines changed: 45 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,92 @@
11
---
22
title: Assistant
3-
description: How to use the Assistant to help you build, grow, and monetize your creations.
3+
description: How to use Assistant to help build, grow, and monetize your creations.
44
---
55

6-
import BetaAlert from '../includes/beta-features/beta-alert.md'
6+
**Assistant** is an AI helper that accelerates content creation by helping you get started, supplementing your skills, and assisting with ongoing development. It can do the following and much more:
77

8-
**Assistant** is an AI helper that can answer questions about building, growing, and monetizing Roblox creations. It is trained on the official Roblox documentation and is designed to answer these categories of questions:
9-
10-
- **Building** — Answers questions about [creating an experience](../creation.md) in Studio.
11-
- **Scripting** — Generate simple [scripts](../scripting/index.md) and/or ask for an explanation of Lua code.
12-
- **Growing** — Answers questions about improving an existing experience by leveraging its [analytics](../production/analytics/index.md).
13-
- **Monetizing** — Answers questions about how to [monetize](../production/monetization/index.md) your experience.
8+
- Answer how to do things on Roblox
9+
- Add and edit objects and scripts directly in your place's data model
10+
- Insert objects from the Creator Store
11+
- "Explain this code" by selecting parts of a script in the Script Editor
12+
- Create materials to restyle your objects
1413

1514
<Alert severity="info">
1615
[Built with Meta Llama 3](https://llama.meta.com/llama3/license/)
1716
</Alert>
1817

19-
## Using Assistant
18+
## Studio Features
2019

21-
Assistant is accessible from both the official [Documentation](../) site and within [Studio](../studio/index.md).
20+
You can access Assistant from [Studio](../studio/index.md) and the [documentation](/assistant), but Studio has the larger set of features. In Studio, Assistant consists of a large language model (LLM) that generates code and a run-command module (similar to the existing [command bar](../studio/ui-overview.md#command-bar)) that runs code.
2221

23-
### From Documentation
22+
As a result, Assistant can act directly on your data model, such as inserting and modifying objects, writing and inserting scripts, and automating repetitive tasks like modifying properties in bulk.
2423

25-
To access Assistant from the official [Documentation](../) site:
24+
For a more in-depth look at what Assistant can do and how to use it, see the [Prompt Guide and Examples](prompt-engineering.md) and the following Roblox Staff livestream for tips, tricks, and inspiration.
2625

27-
1. In the upper navigation bar, click the **Assistant** button.
26+
<iframe width="640" height="360" src="https://www.youtube.com/embed/vMaOGgeuR4Y?si=fuX-80mMMzhQB6sn&amp;start=240" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
2827

29-
<img src="../assets/assistant/Documentation-Button.png" width="650" />
28+
### Insert and Modify Scripts
3029

31-
1. Select a premade question or type your own. See [Prompting Tips](#prompting-tips) for guidance on generating improved responses.
30+
Assistant can insert new scripts, modify existing ones, and perform these actions across multiple objects as necessary. For example, if you ask it to create a remote event, it can create a local script, a server script, and the event all at once.
3231

33-
<img src="../assets/assistant/Documentation-Prompts.png" width="790" />
32+
If you enter a script generation request like "Make the player's character jump when they touch this part," Assistant shows the script's contents and adds the new script instance to the currently selected object in the data model. If nothing is selected, Assistant decides where to place it based on your prompts.
3433

35-
1. Based on the result, you can then:
34+
<img src="../assets/assistant/Studio-Script-Insert.png" width="360" alt="Requested script inserted into selected part." />
3635

37-
- Click thumbs up or thumbs down to rate the result and improve future results.
38-
- Click the redo icon to process a new result.
36+
The generated script might not function flawlessly. In these cases, you can either make further edits in the [Script Editor](../studio/script-editor.md) or ask Assistant to edit the script it just created. It can even act on existing scripts that it didn't create if you need help with code that you've written yourself.
3937

40-
<img src="../assets/assistant/Documentation-Options.png" width="790" />
38+
### Insert and Modify Objects
4139

42-
### In Studio
40+
Assistant can create, edit, delete and iterate on instances in your data model, including inserting items from the Creator Store.
4341

44-
<BetaAlert betaName="Assistant Preview" leadIn="The Studio tooling is currently in beta through " leadOut="." components={props.components} />
42+
<img src="../assets/assistant/Studio-Object-Insert.png" width="532" alt="Assistant adding objects through the Studio prompt." />
4543

46-
To access Assistant from Studio:
44+
If you examine the code, you can see that Assistant calls `Class.InsertService:GetFreeModels()` to query the Creator Store for a wheelbarrow model and uses `Class.Model:PivotTo()` to place it near a tree.
4745

48-
1. Click the **Assistant** button in the top-right corner of Studio.
46+
### Provide Answers and Suggestions
4947

50-
<img src="../assets/studio/general/Toolbar-Assistant.png" width="754" alt="Assistant button indicated in top-right area of toolbar" />
48+
If you need general knowledge or help while creating an experience, you can ask Assistant questions like how to make a team system, how to design a game loop, how to use specific Studio tools, and much more. It can even explain code that it generated or that you wrote yourself.
5149

52-
2. Type a request into the field near the bottom of the window, using guidance from [Prompting Tips](#prompting-tips) to generate improved responses. Based on the result, you can then:
50+
<img src="../assets/assistant/Studio-Explain-Code.png" width="360" alt="Code explanation provided by Assistant in Studio." />
5351

54-
- Click thumbs up or thumbs down to rate the result and improve future results.
55-
- Click the redo icon to process a new result.
56-
57-
<img src="../assets/assistant/Studio-General-UI.png" width="360" alt="General user interface for Assistant in Studio" />
58-
59-
#### Quick Style
52+
### Generate Materials
6053

6154
When given a request to generate a material, Assistant in Studio can quickly style existing parts through a lightweight implementation of the [Material Generator](../studio/material-generator.md).
6255

63-
<img src="../assets/assistant/Studio-Quick-Styling-Material.png" width="360" alt="Material variations shown in Assistant for quick styling" />
64-
65-
#### Insert Script
56+
<img src="../assets/assistant/Studio-Quick-Styling-Material.png" width="360" alt="Material variations shown in Assistant for quick styling." />
6657

67-
If you enter a script generation request like _"Make the player's character jump when they touch this part,"_ Assistant will show the script's contents and add the new script instance to the currently selected object in the data model. If nothing is selected, Assistant will make the placement decision based on your prompts.
68-
69-
<img src="../assets/assistant/Studio-Script-Insert.png" width="360" alt="Requested script inserted into selected part" />
70-
71-
<Alert severity="info">
72-
At times, the generated script may not function flawlessly. In such cases, you can either make further edits in the [Script Editor](../studio/script-editor.md), or select the script snippet and ask Assistant to modify it.
73-
</Alert>
58+
## Accessing Assistant
7459

75-
#### Explain Code
60+
Assistant is available in two locations: Studio and the documentation.
7661

77-
If you enter a request to explain code and you have a code snippet selected in the [Script Editor](../studio/script-editor.md), Assistant explains what that selected snippet does.
78-
79-
<img src="../assets/assistant/Studio-Explain-Code.png" width="360" alt="Code explanation provided by Assistant in Studio" />
80-
81-
## Prompting Tips
82-
83-
The following prompting tips enable Assistant to provide a more detailed and helpful response.
84-
85-
### Context and Details
86-
87-
The more context and examples you can provide in your prompts, the better. Instead of asking _"How can I design a core loop?"_ provide specific contextual examples, such as:
88-
89-
<blockquote>
90-
91-
_Help me design a fun core loop for my game. I want to build a game where players can hunt treasure as pirates. They can also buy and upgrade pirate ships and battle each other._
62+
### In Studio
9263

93-
</blockquote>
64+
To access Assistant from Studio:
9465

95-
### Multi-Step Prompts
66+
1. Click the **Assistant** button in the top-right corner.
9667

97-
Consider using a multi-step prompt to encourage Assistant to think. Instead of simply asking _"Can you explain this script to me?"_ and pasting in the script, ask it to explain step-by-step by separating the question from the script with `###`. Doing so enables Assistant to deconstruct and organize the information clearly to provide better answers.
68+
<img src="../assets/studio/general/Toolbar-Assistant.png" width="754" alt="Assistant button indicated in top-right area of toolbar." />
9869

99-
<Tabs>
100-
<TabItem label="Prompt">
101-
<blockquote>
70+
2. Type a request into the field near the bottom of the window, using guidance from the [Prompt Guide](prompt-engineering.md) to generate improved responses.
10271

103-
_Can you explain what this script is doing step by step?_
72+
- Click thumbs up or thumbs down to rate the result and improve future results.
73+
- Click the redo icon to process a new result.
10474

105-
**\###**
75+
<img src="../assets/assistant/Studio-General-UI.png" width="360" alt="General user interface for Assistant in Studio." />
10676

107-
_local part = workspace.Part_
77+
### From the Documentation
10878

109-
_local function onTouched(otherPart)_<br />
110-
&nbsp;&nbsp;&nbsp;&nbsp;_print(part.Name .. " collided with " .. otherPart.Name)_<br />
111-
_end_
79+
To access Assistant from the [documentation](/assistant):
11280

113-
_part.Touched:Connect(onTouched)_
81+
1. In the upper navigation bar, click the **Assistant** button.
11482

115-
**\###**
83+
<img src="../assets/assistant/Documentation-Button.png" width="650" />
11684

117-
</blockquote>
118-
</TabItem>
119-
<TabItem label="Assistant Response">
120-
<blockquote>
85+
1. Select a premade question or type your own. See the [Prompt Guide](prompt-engineering.md) for guidance on generating improved responses.
12186

122-
_Certainly! This script is an example of how to handle collisions between two parts in Roblox. Let's break it down step by step:_
87+
<img src="../assets/assistant/Documentation-Prompts.png" width="790" />
12388

124-
1. `local part = workspace.Part`: _This line of code creates a local variable named `part` and assigns it the value of the `Part` object located in the workspace. You can replace `Part` with the name of the specific part you want to detect collisions with._
125-
2. `local function onTouched(otherPart)`: _This line of code defines a function named `onTouched` that takes in a parameter `otherPart`. This function will be called whenever the part collides with another part._
126-
3. `print(part.Name .. " collided with " .. otherPart.Name)`: _This line of code prints a message to the output console, indicating that the `part` has collided with `otherPart`. The `part.Name` and `otherPart.Name` are concatenated using the `..` operator to form the message._
127-
4. `part.Touched:Connect(onTouched)`: _This line of code connects the `onTouched` function to the `Touched` event of `part`. Whenever the part collides with another part, the `onTouched` function will be called._
89+
- Click thumbs up or thumbs down to rate the result and improve future results.
90+
- Click the redo icon to process a new result.
12891

129-
</blockquote>
130-
</TabItem>
131-
</Tabs>
92+
<img src="../assets/assistant/Documentation-Options.png" width="790" />

content/en-us/assistant/prompt-engineering.md

Lines changed: 57 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,15 @@ title: Assistant Prompt Guide and Examples
33
description: Get tips and tricks on how best to prompt Roblox's AI Assistant to get the best results.
44
---
55

6-
Assistant in Roblox Studio accelerates content creation by helping you get started, supplementing your skills, and assisting with ongoing development.
6+
<Alert severity="success">
7+
[Share your prompts and experiences](https://devforum.roblox.com/t/check-out-the-generative-ai-stream-and-let-us-know-your-best-prompts/3215844) in the Roblox forum so that we can make Assistant better!
8+
</Alert>
79

8-
Assistant can:
10+
This document gives guidance on prompting Assistant and provides examples and inspiration on what Assistant can do.
911

10-
- Explain how to do things and how scripts work
11-
- Prototype and develop content quickly
12-
- Automate tedious tasks
13-
- Add 3D objects to your workspace
14-
- Add scripts to make things happen
12+
## Be Specific
1513

16-
## Guidelines and Tips
17-
18-
The following sections describe how to get the most out of the Assistant.
19-
20-
### Be as specific as you can
21-
22-
The more specific you are, the better Assistant can help you. Assistant might fail at fulfilling your request if you're not specific enough.
23-
24-
If Assistant fails, add more details to your prompt and try again. Use instance names exactly as they're spelled, specify which function you want Assistant to use, and tell Assistant what type it's working with, like a part or a model.
14+
If Assistant fails, add more details to your prompt and try again. Use instance names exactly as they're spelled, specify which function you want Assistant to use, and tell Assistant which type it's working with, such as a part or a model.
2515

2616
<table>
2717
<tr>
@@ -36,26 +26,67 @@ If Assistant fails, add more details to your prompt and try again. Use instance
3626
<td>Make the part move.</td>
3727
<td>Add a script to make "my_part" move up and down 10 studs repeatedly using TweenService.</td>
3828
</tr>
29+
<tr>
30+
<td>How can I design a core loop?</td>
31+
<td>Help me design a fun core loop for my game. I want to build a game where players can hunt treasure as pirates. They can also buy and upgrade pirate ships and battle each other.</td>
32+
</tr>
3933
</table>
4034

41-
### Use your selection
35+
## Use Your Selection
4236

43-
Selection is a great way of specifying an object or set of objects you want to refer to in your prompt. You can select multiple objects and ask Assistant to modify the selected objects, make duplicates and place them somewhere, or continue a position pattern like maintaining placement in a line.
37+
Selection is a great way of specifying an object or set of objects you want to refer to in your prompt. Select multiple objects and ask Assistant to modify them, make duplicates and place them somewhere, or continue a position pattern like maintaining placement in a line.
4438

45-
### Edit time vs Run time
39+
## Edit Time and Run Time
4640

47-
Assistant sometimes confuses the difference between edit time and run time. If you ask Assistant to take an action, it will likely bias towards doing it at edit time. If you want the action to happen during run time, ask Assistant to insert a script to the take action. For example, tell Assistant to "add a script to make the time of day 8am" instead of "make the time of day 8am".
41+
Assistant sometimes confuses the difference between edit time and run time. If you ask Assistant to take an action, it will likely bias towards doing it at edit time. If you want the action to happen during run time, ask Assistant to insert a script that takes the action. For example, tell Assistant "add a script to make the time of day 8:00 AM" instead of "make the time of day 8:00 AM."
4842

49-
### Keep trying (with tweaks) and don't give up
43+
## Keep Trying
5044

51-
Don't get discouraged if Assistant doesn't work exactly the way you want the first time. Often, making small tweaks and trying again can lead to better results. Many AI tools are non-deterministic, which means they don't create the exact same output each time you ask them to do something. There's natural variance, which you can tap into and control using tweaks to your prompt.
45+
Don't get discouraged if Assistant doesn't work exactly the way you want the first time. Often, making small tweaks and trying again can lead to better results. Many AI tools are non-deterministic, meaning they don't create the exact same output each time you ask them to do something. There's some variance, which you can tap into and control using tweaks to your prompt.
5246

5347
AI in its current state requires work. It takes time to understand how to best speak to Assistant, what it can do, and how to get what you want out of it.
5448

49+
## Multi-Step Prompts
50+
51+
Consider using multi-step prompts to encourage Assistant to think. Instead of asking "Can you explain this script to me?" and pasting in the script, ask it to explain step-by-step by separating the question from the script with `###`. This separation helps Assistant deconstruct and organize the information to provide better answers.
52+
53+
<Tabs>
54+
<TabItem label="Prompt">
55+
<blockquote>
56+
57+
_Can you explain what this script is doing step by step?_
58+
59+
**\###**
60+
61+
_local part = workspace.Part_
62+
63+
_local function onTouched(otherPart)_<br />
64+
&nbsp;&nbsp;&nbsp;&nbsp;_print(part.Name .. " collided with " .. otherPart.Name)_<br />
65+
_end_
66+
67+
_part.Touched:Connect(onTouched)_
68+
69+
**\###**
70+
71+
</blockquote>
72+
</TabItem>
73+
<TabItem label="Assistant Response">
74+
<blockquote>
75+
76+
_Certainly! This script is an example of how to handle collisions between two parts in Roblox. Let's break it down step by step:_
77+
78+
1. `local part = workspace.Part`: _This line of code creates a local variable named `part` and assigns it the value of the `Part` object located in the workspace. You can replace `Part` with the name of the specific part you want to detect collisions with._
79+
2. `local function onTouched(otherPart)`: _This line of code defines a function named `onTouched` that takes in a parameter `otherPart`. This function will be called whenever the part collides with another part._
80+
3. `print(part.Name .. " collided with " .. otherPart.Name)`: _This line of code prints a message to the output console, indicating that the `part` has collided with `otherPart`. The `part.Name` and `otherPart.Name` are concatenated using the `..` operator to form the message._
81+
4. `part.Touched:Connect(onTouched)`: _This line of code connects the `onTouched` function to the `Touched` event of `part`. Whenever the part collides with another part, the `onTouched` function will be called._
82+
83+
</blockquote>
84+
</TabItem>
85+
</Tabs>
86+
5587
## Examples
5688

57-
These examples demonstrate the vast variety of tasks Assistant can help with today.
58-
Some of these examples might take a few tries for you to reproduce, but give them a try and see what you can come up with yourself.
89+
These examples demonstrate the vast variety of tasks that Assistant can help with today. Some of them might take a few tries for you to reproduce, but give them a try and see what you can come up with yourself.
5990

6091
### Game Mechanics - Shooting Fireballs that Explode
6192

@@ -75,14 +106,14 @@ Add a script to make a system of teams (red, blue, green, yellow) and assign eac
75106
### Game Mechanics - Temple Run Style Constant Running
76107

77108
**Prompt:**
78-
Make my character run forward constantly like in a temple run game
109+
Make my character run forward constantly like in a temple run game.
79110

80111
<video controls width="90%" src="/assets/assistant/prompt3.webm" />
81112

82113
### Game Mechanics - Fire Power Up
83114

84115
**Prompt:**
85-
Add a script that makes the player light on fire and jump 3 time as high if they press "q". The fire should be attached to the player and move with them. If they press "q" again, turn off the fire and reset the jump power
116+
Add a script that makes the player light on fire and jump 3 time as high if they press "q". The fire should be attached to the player and move with them. If they press "q" again, turn off the fire and reset the jump power.
86117

87118
<video controls width="90%" src="/assets/assistant/prompt4.webm" />
88119

0 commit comments

Comments
 (0)