Hello,
I'm not sure this is completly connected to the Dialogue system, but anyway
I've made an game object which has added component usable and it react's with interact message when player is in it's collider.
When I press interact button I want to destroy the item from the scene and disable / hide this interact message.
So I made OnUse function in my script and in it I was trying to disable the object. But after this message to interact still stays.
I've also tried to move/translate the object off scene but message is still visible and object is still interactable until I move with player.
I guess there is no OnTriggerExit sending when I destroy it, so I understand the message stays...
How can I solve this the best?
Thank you !
Disable message to interact when object destroyed
-
- Posts: 9
- Joined: Mon Nov 03, 2014 3:21 pm
Disable message to interact when object destroyed
Are you by any chance using the new Unity UI with the support package that came in Dialogue System v1.3.7? There was a bug in this support package that wouldn't hide the interaction message when a targeted GameObject was destroyed. It's fixed in v1.3.8. However, please be aware that v1.3.8 uses an open source library called Rotorz Reorderable List. UMA doesn't play nicely with this library. Version 1.3.9 will remove this library from the Dialogue System. If you use UMA, stay with v1.3.7 and download the patch for Unity UI support from the customer download site.
If this isn't the issue, you could always fake the OnTriggerExit like this:
GameObject.Find("Player").SendMessage("CheckTriggerExit", this.gameObject);
This makes ProximitySelector think that this.GameObject just left the player's trigger area.
If that doesn't help, please let me know what version of Unity and Dialogue System you're using, and what GUI system.
If this isn't the issue, you could always fake the OnTriggerExit like this:
GameObject.Find("Player").SendMessage("CheckTriggerExit", this.gameObject);
This makes ProximitySelector think that this.GameObject just left the player's trigger area.
If that doesn't help, please let me know what version of Unity and Dialogue System you're using, and what GUI system.