Prefabs - Reading Assignment

Read this article: https://docs.unity3d.com/Manual/Prefabs.html

1. What is a prefab?
2. Why should we use a prefab instead of copying the GameObjects?
3. Give some examples of situations in which a prefab might be necessary.

1 Like

1. What is a prefab?
A prefab is a way to create copies of a ‘previously fabricated’ item. You can then use them everywhere and can manipulate many instances while only making changes to the original.

2. Why should we use a prefab instead of copying the GameObjects?
This will save us a lot of time.

3. Give some examples of situations in which a prefab might be necessary.
NPCs, props, or pieces of scenery.

2 Likes

1. What is a prefab?
An instance which you can load in your project which will have values and behaviors which you can connect to objects.

2. Why should we use a prefab instead of copying the GameObjects?
When you update a prefab it will automatically update your wish to all the objects where the prefab is related to. When you use copy, you have to update all the scripts when you want to implement a change.

3. Give some examples of situations in which a prefab might be necessary.
For example, behavior of trees or campfires. Or other objects which are used regularly.

1 Like

1. What is a prefab?
A Prefab is an object that acts as a template so that it can be instantiated multiple times in a scene but be conveniently manipulated in one place so that all instantiations have the same properties and are in sync.
2. Why should we use a prefab instead of copying the GameObjects?
Because of the convenience of being able to keep copies in sync if we need several objects of the same type. GameObjects can be altered individually which may not be desirable.
3. Give some examples of situations in which a prefab might be necessary.
NPCs (enemy characters of the same class such as Orcs or soldiers for example)
Collectibles (Bananas, Coins in Platformers)

1 Like

1 Like

Prefabs

  1. Prefabs are templates for reusable objects
  2. Always avoid copy/paste code :-) make it easier to use and modify during the game.
  3. The Main Player Character and Non Player Characters like ivanOntech-zombies or robots.
    Environmental assets like tree's or filip's chair.
    Projectiles like asteroids, atomic clockbullets :-)
    Creating special effects during the game.
    ...

greetzzz

1 Like
  1. A prefab is a set of game objects that share similar attributes that the developer likely wants to make changes to all at once.

  2. Saves time developing and gives flexibility of control in case any individual objects need special treatment.

  3. The coins in the game we’re building now. Power-Ups, common NPCs, common buildings or scenery.

1 Like

1. What is a prefab?
When you want to reuse a GameObject, like a tree to be present on more places in game, you can use prefab system.
2. Why should we use a prefab instead of copying the GameObjects?
Because any edits you make on prefab asset are automatically reflected in instances of prefab asset objects. This is allowing to easily make broad changes across the whole Project or Game without need to input the same edit for every asset.
3. Give some examples of situations in which a prefab might be necessary.
environmental asset like tree, it can be used multiple times on a level of game
non-player characters like robot, it can appear in game multiple times on different levels
projectiles like missile it can be instantiated every time when missile launcher fires
player’s main character, it can be placed at the starting point of each level