Creating and Working with Prefab Brushes in Unity (2D Extras)

Following on from the previous article on Animated Tiles, another nifty little thing we can work with using Unity’s 2D Extras are these Prefab Brushes. As the name suggests, they allow us to ‘paint’ our own prefabs onto tilemaps within our scenes. This can particularly come in handy when you need to, say, dot some coins or other collectibles around your scene (and which might well have custom scripts and behaviours).

If you’ve imported the 2D Extras assets, you should be able to right click in your Project view and navigate to Create > Brushes > Prefab Brush.

With your newly-created Prefab Brush selected in the Project window, you can take a look in the Inspector and set things up there to your liking. In particular, we can increase the size of an array of prefabs and can drag in any prefabs we’d like from our project.

These additional prefab slots can come in handy if we want to have a bit more randomisation when painting onto our scene, for instance if we wanted to have a mix of bronze and silver coin prefabs (each worth a different amount).

Once you’ve set this up, you should be able to select this brush from the brush dropdown towards the bottom left of the Tile Palette window:

With that (and the paint brush icon selected) you can now paint your prefabs into your scene 😉

--

--

--

Game Developer | Game Design and Literature Graduate

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Running environment based changes from liquibase script in postgres

changes related to the environment

My Udacity Journey.

Building Quartermaster: My First CLI Application

Basic Security Configurations on JBOSS EAP 7

History of QR Code

Converting your GitHub.com public GoLang repo into a class diagram

Deploying Django REST/MariaDB, Gunicorn, Supervisor, Nginx on Centos 7/Linux

Great Youtube Channels to Follow

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Marcus Ansley

Marcus Ansley

Game Developer | Game Design and Literature Graduate

More from Medium

Loading Scenes In Unity

Guide to Terrains in Unity

Using Light Layers and Volumetric Lighting in Unity’s HDRP

Galaxy Shooter 2D — Homing Missile