Creating a FUNCTION


🧩 Auxiliary Functions

Auxiliary Functions are blocks of actions not linked to buttons, created to reuse logic and organize your project.

They are ideal for those who want to modularize their HUD and make the creation process cleaner, faster, and more efficient.


🧠 What Is an Auxiliary Function?

It’s a function created without being directly tied to a button. As the name suggests, it serves to support the project, especially with repetitive tasks or reusable logic.


✅ Advantages of Using Auxiliary Functions

  • Avoids code repetition: run the same sequence of actions from multiple buttons without duplicating it.

  • Saves memory: fewer duplicated actions in the scripts.

  • Simplifies maintenance: update a detail (like a color or sound) in just one place.

  • Modularity: keeps your project cleaner, more organized, and more professional.

📌 Practical Example:

You need to change the color of several objects using different buttons.

  • Without auxiliary function: create a color action in each button.

  • With auxiliary function: create a single function for the color change, and call that function from all buttons.

Result: if you want to change the color later, you only need to update one place, and all buttons will be updated automatically.


✳️ How to Create an Auxiliary Function

  1. Access your creation panel.

  2. In the center of the screen, click the green button with the “+” icon next to the FUNCTIONS title.

  3. Choose a unique name for the function:

    • Avoid duplicate names.

    • ⚠️ Do not use the same name as a button (linked prim) to avoid conflicts on click.

  4. Click CREATE.

✅ Done! Your Auxiliary Function has been created and is ready to be edited.


🔗 How to Call an Auxiliary Function from a Button

To trigger an auxiliary function from any button, just use the action:

ACTIVE FUNCTION

This action executes the desired auxiliary function.

🔍 Want to learn how to use ACTIVE FUNCTION? Click here


Last updated