lexonegit / Unity-Twitch-Chat

Lightweight and easy-to-use Twitch IRC client for Unity (C#)
Other
122 stars 24 forks source link
chat client easy example irc lightweight livestream multi-threaded streaming twitch twitchirc unity

Unity Twitch Chat

This is a lightweight and efficient Twitch.tv IRC client for Unity.

In short, this allows you to integrate Twitch Chat to your Unity projects.
The primary goal is to be able to read and send chat messages as efficiently as possible.

Chat message example

Supported features

Unsupported features

Other limitations

Installation

Quick start

  1. Install the Unity package (see above)
  2. Create a new empty GameObject and add the Twitch IRC component.
  3. In the inspector, set your Twitch details (OAuth, username, channel)
  4. Make sure Connect IRC On Start and Join Channel On Start are enabled and press play – You should now see JOIN messages, etc. in the console.
  5. Create a new script that has a listener for the IRC.OnChatMessage event.
    • See ListenerExample.cs for reference.
    • The listener will receive Chatter objects which contain information about each chat message, such as the chatter name, message, emotes, etc...

Having issues? Check out the included ExampleProject for a better understanding.

Example project

Spawn chatters as jumping boxes. Box color is based on their primary badge.

API documentation

IRC.cs

Chatter.cs

License

MIT License

Projects made with Unity Twitch Chat

Intro Fighters, stream overlay game https://lexone.itch.io/introfighters

Did you make something cool? Contact me (lexone on Discord) to get featured here!