Forum rules - please read before posting.

OnMouseOver broken by AC?

Unity event systems and OnMouse{X} functions no longer work in my project, even if AC's engine is not loaded in the scene. Are there project-level changes I need to be aware of to only use AC in specific scenes? I spent four hours trying every permutation in Unity, so I need to look into AC-related issues.

Comments

  • Welcome to the community, @SmilingBandit. Apologies for the annoyance.

    AC does have its own input code and EventSystem classes, but nothing that should run if AC is not present in the scene - and certainly not anything that should prevent other code from running.

    What are your AC and Unity versions, and can you share a sample code snippet that's not working - as well as details of how it's not working?

    Are you having such issue(s) when starting the game from a non-AC scene, or only when transitioning to a non-AC scene after an AC scene has been visited?

    In this latter scenario, where AC has been loaded, but a non-AC scene is then loaded, AC will "sleep" - with its PersistentEngine object still remaining in the DontDestroyOnLoad section of the Hierarchy. Does the issue only occur when this is the case?

  • Thanks. It's good to know that it's probably not AC, because as annoying as troubleshooting is, AC's a great product and saves months of work. I'd much rather I was making an error than an incompatibility.

    Unity version is 2019.4 and AC is 1.73.8

    Code in question:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    
    
    namespace BTB
    {
        public class InventoryObjectController : MonoBehaviour
        {
            public GridmapController GC;
            public UnityEngine.UI.Image DisplayImage;
            public UnityEngine.UI.Text DisplayQuantity;
            void Start()
            {
                GC = GameObject.Find("C3i").GetComponent<GridmapController>();
            }
    
            private void OnMouseEnter()
            {
                Debug.Log("sure");
                GC.TooltipOn();
            }
    
            private void OnMouseExit()
            {
                GC.TooltipOff();
            }
    
            private void OnMouseOver()
            {
                Debug.Log("WHEEE!");
            }
        }
    }
    

    There is no function called or debug log created. The object has been tested with many permutations of collider types, rigidbodies, etc. Known child of rigidbody errors should not have occurred, and were tested by using the button in the object root.

    It's helpful to note that a button in this object does not work at all, and an event handler + button in the root only registers clicks.

    This is in a scene running directly from the editor without loading AC in a previous scene. I've tried loading the AC manager but problem persists.

    If AC changes filtering to not click on UI objects, that's one of my prime thoughts (but it sounds like that's not the case) and I've tried fiddling with the UI click blocking AC option.

    If we figure that it's not AC, I appreciate it, but the button prefab no longer working points to a larger configuration issue, and AC's the biggest asset I have, and it touches a lot of stuff.

  • Thanks for the details. What of the object the script is attached to - can you share its Inspector?

    You mentioned that this no longer works - are you aware of which point it stopped working?

    As the OnMouseEnter etc functions are all built-into Unity, the only way I could think that they could be interfered with is through a changing of a editor/project setting, e.g. Physics.queriesHitTriggers, as opposed a component/script property.

    I guess the quickest way to rule out AC's involvement would be to duplicate the project, remove AC from the copy, and run the scene.

  • edited August 2021

    Thanks for the troubleshooting assistance. I have no idea what the issue is, but I've managed to work out that AC is not the problem (at least when not in the scene, I haven't tested further), and I couldn't be happier. Thanks for all the hard work, I love this product, and it's a relief that I can keep using it.

    Edit: For posterity/Google purposes, I was an idiot and used an screen space overlay canvas instead of a screen space camera canvas. Stupid mistake. So glad it was my mistake.

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.