Skip to content

Add Scratch control units (if/else, wait until, repeat until)#378

Merged
oco777 merged 1 commit intomainfrom
codex/add-scratch-style-control-units-to-visual-scripting
Nov 24, 2025
Merged

Add Scratch control units (if/else, wait until, repeat until)#378
oco777 merged 1 commit intomainfrom
codex/add-scratch-style-control-units-to-visual-scripting

Conversation

@oco777
Copy link
Copy Markdown
Owner

@oco777 oco777 commented Nov 24, 2025

Summary

  • add Scratch-style If/Else, Wait Until, and Repeat Until visual scripting units under the control category
  • implement coroutine-based waiting/repeat behaviors consistent with existing Scratch units
  • update VS Scratch mapping documentation to list the new control units and correct categories

Testing

  • not run (not requested)

Codex Task

@oco777 oco777 merged commit 29ad2ec into main Nov 24, 2025
3 checks passed
@oco777 oco777 deleted the codex/add-scratch-style-control-units-to-visual-scripting branch November 24, 2025 10:08
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +135 to +138
private ControlOutput OnEnter(Flow flow)
{
var condition = flow.GetValue<bool>(m_Condition);
return condition ? m_IfTrue : m_IfFalse;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Provide exit continuation from IfElseUnit branches

The new IfElseUnit only returns either ifTrue or ifFalse from OnEnter and defines no exit/control output to rejoin after the branch, so when the condition is false and the graph leaves the ifFalse port unconnected (the common case when modelling a Scratch “if/else” with an empty else), the script dead‑ends instead of continuing to the next block as Scratch does and as IfThenUnit already does with its exit output. This will halt scripts whenever the else branch is empty or not wired, diverging from Scratch control flow.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant