MetaForge Documentation
Fab Store PageDiscord
  • MetaForge
    • Getting Started
    • Plugin Configuration
    • Runtime Configuration
    • Project Configuration
    • Model Objects
    • Model Managers
    • Registering Models
    • Conditionals
    • Validators
    • References
    • References (Advanced)
    • Property Drawers
    • List Properties
    • IDE File Templates
    • Runtime Usage
  • Contact Us
Powered by GitBook
On this page
  • Adding a Method to Retrieve Models
  • Using the Method in Blueprints
  1. MetaForge

Runtime Usage

PreviousIDE File TemplatesNextContact Us

Last updated 5 months ago

Adding a Method to Retrieve Models

To use MetaForge at runtime, you can add a method to a Blueprint Function Library to retrieve your model objects. Since you already have a Blueprint Library for initialization, that would be an ideal place to add this functionality, but any Blueprint Library will work.

Here's an example of a method that retrieves model objects:

UFUNCTION(BlueprintCallable, Category = "Meta Forge")
static TArray<UDemoCharacter*> GetCharacters();

...

TArray<UDemoCharacter*> UInitializer::GetCharacters()
{
    return UDemoCharacterManager::GetInstance()->Objects;
}

This method returns a list of UDemoCharacter objects from the UDemoCharacterManager singleton. You can modify the return type and the logic based on the model objects you want to retrieve.

Using the Method in Blueprints

Once you've added the method to your Blueprint Function Library, you can hook it into any Blueprint in your game. For example, you can use the GetCharacters method to populate a list in your UI, as shown in the following screenshot:

This screenshot demonstrates how you can use the GetCharacters function to get a list of characters and set them as items in a List View widget, making it easy to integrate MetaForge data into your runtime gameplay features.

Runtime Blueprint Usage