# Interacting with Sprite and UI Buttons in a Unity Game

DevFeed: [Interacting with Sprite and UI Buttons in a Unity Game](<https://devfeed.tech/articles/interacting-with-sprite-and-ui-buttons-in-a-unity-game-21806.md>)

Original publisher: [Read original article](<https://www.thepolyglotdeveloper.com/blog/2021/12/interacting-sprite-ui-buttons-unity-game/>)

Author: Nic Raboy

Published: 2022-01-01T00:57:42Z

Content type: tutorial

Language: en

Sources: [Nic Raboy](<https://devfeed.tech/sources/nic-raboy.md>)

Topics: [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [Unity](<https://devfeed.tech/topics/unity.md>), [Game Development](<https://devfeed.tech/topics/game-development.md>), [ui](<https://devfeed.tech/topics/ui.md>), [C#](<https://devfeed.tech/topics/csharp.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [csharp](<https://devfeed.tech/tags/csharp.md>), [game-development](<https://devfeed.tech/tags/game-development.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [ui](<https://devfeed.tech/tags/ui.md>), [unity](<https://devfeed.tech/tags/unity.md>), [unity3d](<https://devfeed.tech/tags/unity3d.md>)

## AI overview

This tutorial explains how to create interactive buttons in a Unity game using both 2D sprites and Unity UI buttons. It covers adding a sprite, attaching a C# script and Box Collider 2D, and creating a legacy UI button within a canvas.

## Source excerpt

When you're developing a game, whether it be 2D or 3D, you're going to need to add menus with buttons at some point. These buttons could be as simple as a means to exit the game, or something more com... The post Interacting with Sprite and UI Buttons in a Unity Game appeared first on The Polyglot Developer.