Forum rules - please read before posting.

Change AC menu font color through Action

edited May 3 in Technical Q&A

Hi there,
I've successfully created a custom action to change a menu element font and font size but I can't succeed in changing font color.
This is my script:

using UnityEngine;

using UnityEditor;

namespace AC
    public class ActionChangeFontColor : Action
        // Declare variables here
        public string MenuName;
        public string ElementName;
        public Color MyFontColor;

        public ActionChangeFontColor()
            this.isDisplayed = true;
            category = ActionCategory.Menu;
            title = "Change Menu Font Color";
            description = "Change Menu Font color";
        override public float Run()
            AC.PlayerMenus.GetElementWithName(MenuName, ElementName).fontColor = MyFontColor;
            return 0f;

        override public void ShowGUI()
            // Action-specific Inspector GUI code here
            MenuName = EditorGUILayout.TextField("Menu name:", MenuName);
            ElementName = EditorGUILayout.TextField("Element name:", ElementName);
            MyFontColor = EditorGUILayout.ColorField("Font Color:", MyFontColor);


no matter which color I choose, the text stops appearing.
What am I doing wrong?


  • The code looks correct - does the new colour have its alpha set to 1?

  • I'm an idiot...
    Thanks and sorry for bothering!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.