Haydee 2

Haydee 2

View Stats:
 This topic has been pinned, so it's probably important
[EDITH] References
What is a reference? What is it for? Is it less or more resource heavy than just spawning a template? Is it more ideal for just clutter that I don't plan to interact with?
< >
Showing 1-2 of 2 comments
antales  [developer] Dec 5, 2020 @ 7:05am 
At thirst we need to understand how templates work.

There are actors on the scene. They store their data on the scene in which you spawned them. Actors have their component and components setup.

Templates are ready-to use actors, stored in external files. They have their components and components setup.

When you use a "Spawn Template" it doesn't spawn the template itself. Instead it creates a new actor wich copies all component and their setup from the template. After that this actor exists within the scene and has no connection to template it was spawned from. You can change this actor as you like and change the template as you like. They will not influence each other.

However there are situations when you want to force that connection, you want for you actor to be identical to the template data. Then you use the reference. Reference don't create an actor on scene. Instead it creates a reference to template. So when the game starts a new actor will be spawned with current template's parameters.

For example, you spawn the same oblect over 100+ senes. And at some point in the development you decided, that you need to change this object. Change a texture for a mesh, for example. If you used the first method, then all you object are separate actors not connected with each other. You need to manually pick each one of them and manually change its texture. But if you spawned this object as a reference, then all you need is to change the template contents and all you objects on all the scenes will update automaticaly.
Molotov Hotdog Dec 5, 2020 @ 12:13pm 
Oh okay, thank you for the response, that makes a lot of sense.
< >
Showing 1-2 of 2 comments
Per page: 1530 50