Forum rules - please read before posting.

[bug] Highlight error after 1.41a or 4.6 Unity upgrade

edited December 2014 in Technical Q&A
I say "or" because I haven't tested the old AC with Unity 4.6. I also didn't download 1.41 before 1.41a.

MissingReferenceException: The object of type 'Highlight' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
AC.Highlight.UpdateMaterials () (at Assets/AdventureCreator/Scripts/Object/Highlight.cs:254)
AC.Highlight._Update () (at Assets/AdventureCreator/Scripts/Object/Highlight.cs:139)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:141)

not sure what's going on here, it didn't happen before the update...
This happens after I pick up an item from the terrain. The Actionlist, which is an in-scene "use" action linked to a hotspot, so it runs when you click on it, is like this:

1) disable the current hotspot
2) remove a certain gameobject from the scene (can't just turn it invisible because it has a collider)
3) add an item to the inventory
4) remove the "Use: blabla" itself (this could be taken off actually)

The error is due to 2) since when I disable it it runs fine. 
I tried disabling "Brighten materials" and as I suspected the error doesn't happen if I do this. I suspect it's due to something gone wrong after 
"-Fixed: Highlight script brightening objects even if "Brighten materials" is unchecked"

Comments

  • It's actually down to the object being deleted.  I may be able to fix this in 1.42, but in the meantime you could teleport the object out of the player's view, rather than deleting it.
  • Thanks, Chris.
    Will wait for a fix but definitely not urgent, yeah.
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.