With this function you can create a weak reference to a struct which can then be used to check if the struct is still "alive" (referenced) or not in the game. You supply the reference to the struct you want to track, and the function will return another struct which is a weak reference to that struct.
weak_ref_create(struct_to_track);
Argument | Type | Description |
---|---|---|
struct_to_track | Struct or Method | The struct or method that you want to create a weak reference for |
inventory_ref = weak_ref_create(inventory);
The above code creates a weak reference to a struct and stores it in an instance variable for later use.