Forum rules - please read before posting.

Script for closing inventory when player moves needs help

Hi,

For my previous game using UNITY 2019.4.14f1 and AC V1.66.8 i had a script that would close or open certain menus on player move. However, in bringing this script into my new game using UNITY 2020.3.19f1 and AC V1.74.2 it now gives me an error.

Here is script:

using UnityEngine;
using System.Collections;
using AC;

public class CloseInventory : MonoBehaviour
{
void Awake()
{
DontDestroyOnLoad(this.gameObject);

}
void Start()
{

}
private void Update()

{

    if (KickStarter.player.IsMovingAlongPath())
    {
        PlayerMenus.GetMenuWithName("RealWorldInventory").TurnOff();
        PlayerMenus.GetElementWithName ("InGame", "IconPhone").TurnOn();
    }


}

}

and here is error:

Assets/Sleepytime Village/Scripts/CloseInventory.cs(24,59): error CS1061: 'MenuElement' does not contain a definition for 'TurnOn' and no accessible extension method 'TurnOn' accepting a first argument of type 'MenuElement' could be found (are you missing a using directive or an assembly reference?)

Can you help?

Comments

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.