Forum rules - please read before posting.

Objectives Question!

So I want to introduce the system that whenever I complete an objective the simple check box is filled with a green tick. How can I do that? Everything is part of a single menu the "Objective" one! Thank You!
https://imgur.com/7S7oLcN
https://imgur.com/PwEnKW8

Comments

  • You'd need a short script that reads the state of the selected Objective, and affects the appearance of the tick based on that.

    If your Menu uses "Adventure Creator" as its Source, you'd need to create the tick as a separate "Graphic" element, named "Tick", and then set its visibility:

    using UnityEngine;
    using AC;
    
    public class ObjectiveTick : MonoBehaviour
    {
    
        void Update ()
        {
            bool showTick = false;
            if (KickStarter.runtimeObjectives.SelectedObjective != null)
            {
                var stateType = KickStarter.runtimeObjectives.SelectedObjective.CurrentState.stateType;
                showTick = (stateType == ObjectiveStateType.Complete);
            }
            PlayerMenus.GetElementWithName ("Objectives", "Tick").IsVisible = showTick;
        }
    
    }
    

    If you were to use Unity UI, you could alternatively use an Image component not linked to the Menu, and attach a script to affect its appearance in a similar way.

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.