Prototypes vs. Instances
Prototypes vs. Instances
Learning Objectives
•Understand how to edit the behaviour of an actor prototype and how this relates to instances of the actor.
•Learn what it means to edit the behaviour of an instance of an actor.
A GameSalad game consists of scenes. Actors are placed inside scenes. How actors work is defined by their rules, behaviours, and attributes.
An actor’s prototype is like the blueprint for a house. Let’s make an actor and edit it’s prototype now. Watch this video to get started:
1 - Create an Actor and Edit Actor Prototype.mov
Next, we’ll create two instances of this actor. Each instance will “work” the same way in the game, because they are based on the same actor prototype. Take a look, here:
2 - Create Instances of an Actor.mov
If you double-click an instance of an actor, you are essentially “branching” that instance away from the blueprint, or prototype. Any changes you make to an instance of an actor apply only to that instance. Take a look:
3 - Editing an Instance of an Actor.mov
There’s one final important point to understand: once you edit an instance of an actor – that instance will no longer “pick up” or “get” any of the changes you make to the actor’s prototype. Watch this for an illustration:
4 - Edited Instances of an Actor Don't Pick Up Any Further Changes Made to the Prototype.mov
Moral of the story: directly edit an instance of an actor only when you really need to – that is, you want to have just that one instance behave a certain way. And, be careful about when you edit an instance – after you do so, the instance will no longer pick up any additional changes made to the actor’s prototype.
What should you do, 99% of the time? You’ll want to edit the prototype so that all of your instances of that actor behave the same way (for example, a swarm of enemy actors that share the same method of attack).
Editing Actors: Changing a Prototype vs. Changing an Instance
Image from GameSalad Creator.