Basic Example
I'll go through a quick walkthrough to get you familiar with the end-to-end flow of ModScripting.
Changing Memeorang Man's Gravity
-
First, open the Level Builder, and open the level options panel:
-
Enable experimental features:
-
Exit the level options panel, then find and click on Memeorang Man. Then click the blue script button:
-
Create a new ModScript, and you'll see something like this:
-
Open the API Reference, and find the
gravityScale
field of thePlayer
'sRigidbody2D
component: -
Click the
Copy Example
button: -
Paste that example into the script editor, and add the line
memeorangManRigidbody2D.gravityScale = 0.069
at the end to change the gravity: -
Now exit the ModScript panel, and enter play mode. You should see low gravity while jumping with Memeorang Man. Congratulations.