Home » Updates » Added -> random avatar actions / Twich chat color as chat color

Added -> random avatar actions / Twich chat color as chat color

+ Twitch chat color can now be used as the chat color that avatars use as their chat color
Avatars have a new property called ChatColor -> Avatar.ChatColor, this contains the chat color of the user that chats on twitch. If it’s not set then the color is default.

+ Random avatar actions + example

Below is an example how avatars can do random action.
Avatar actions are defined in the avatar text file and ideally you want the avatar do something more intelligent than random stuff.

View post on imgur.com

if (avatarItem.Action.CurrentFrame >= avatarItem.Action.Frames) {
	var currentAction = avatarItem.Action; // keep current X/Y
	avatarItem.Action = avatarItem.Actions[Math.floor((Math.random() * avatarItem.Actions.length) + 0)]; //get a random action
	avatarItem.Action.IsReverse = Math.floor((Math.random() * 50) + 1) <= 25; //random direction 
	avatarItem.Action.CurrentPosX = currentAction.CurrentPosX;
	avatarItem.Action.CurrentPosY = currentAction.CurrentPosY;

+ Avatar variations
Added support for avatar variations meaning if you have multiple avatars but with slight differences like color etc, you don’t need to create a new data file with the same actions. For examples, I have a bunch of jellybean avatars with different color variations but otherwise they are the same. To do this you need to add the variation names in the main file like this:


.. and then define the avatar actions that work on all variations. Don’t forget to put the variations in the Assets/avatar directory for it to load automatically.


About the author


Herrow, I'm BlushyFace and you are you. I also stream @ Twitch channel community.

Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments