Skip to content

findScript|findScripts returns Script instead of the deprecated#8601

Open
saidmoya12 wants to merge 1 commit intoplaycanvas:mainfrom
saidmoya12:main
Open

findScript|findScripts returns Script instead of the deprecated#8601
saidmoya12 wants to merge 1 commit intoplaycanvas:mainfrom
saidmoya12:main

Conversation

@saidmoya12
Copy link
Copy Markdown

Description

findScript and findScripts returns Script instead of the deprecated ScriptType.

Changes

Now we can cast in typescript using

const myScript = entity.findScript("scriptName") as MyExtendedScript

Checklist

  • I have read the contributing guidelines
  • My code follows the project's coding standards
  • This PR focuses on a single change

@Maksims
Copy link
Copy Markdown
Collaborator

Maksims commented Apr 15, 2026

This PR is potentially will break some advanced code.
First of all properties of a class should start from a lowercase letter, not uppercase.
Additionally it introduces a variable, that is not in private notation, that likely will collide with people's code who uses that property. Polluting script space - should be last resort.

Also, ScriptType extends Script, so there should not be a problem with existing code, as user can easily check for both.
If it is related to TypeScript, then TypeScript related issue should be solved without changing JS side.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants