Run Script remembers required modules

Reproduction Steps
Create a script (A) that requires a module script (B). Save script A to a file. Use studio’s Run Script button and select script A. Now change script B. Then use Run Script on script A again and it will still use the old version of script B.

Expected Behavior
I expect the require cache to be completely clear every time I run a script using “Run Script”.

Actual Behavior
“Run Script” seems to keep required modules cached between script runs.

If you delete the required module(s) and run the script again, it will give an error about the module not existing. Then put the module back, run again, and it will use the updated module.

Issue Area: Engine
Issue Type: Other
Impact: Moderate
Frequency: Sometimes
Date First Experienced: 2021-09-27 00:09:00 (-04:00)
Date Last Experienced: 2021-09-27 00:09:00 (-04:00)


Sorry, this should actually be under “Studio Bugs” not “Engine Bugs”. I’m not sure how to change that.

try editing the post to change the post category.

Hi, thanks for the report! By “studio’s Run Script” are you reffering to Run(F8)?


Hi, no problem, thanks for the response. No this is in reference to the “Run Script” button which can be found on the “Model” tab in the “Advanced” section (right after “Collision Groups”). It can also be added to the Quick Access Bar. I don’t think there’s a hotkey associated with it by default.

This is a side-effect of how we cache modules in our engine and it is therefore not a bug. However, I agree that this can make testing changes to modules difficult. We are investigating changes we can make to how caching works when the source of a module is updated but don’t expect any changes in the near future.