Hi,
I am using ProximitySelector/Usable/DialogueSytstemTrigger to start the conversation.
Once the conversation is done, since the player did not re-enter the collider it does not call OnSelect().
Problem is: I am using OnSelect()/OnDeselect() to show dialogue indicator that you can talk to this person or not.
What would be a better solution around this?
calling OnSelect() on ProximitySelector after the conversation?
Re: calling OnSelect() on ProximitySelector after the conversation?
Hi,
If you're using the Usable's OnSelect() and OnDeselect(), then remember that the Usable is still selected even after the conversation. Example:
If you're using the Usable's OnSelect() and OnDeselect(), then remember that the Usable is still selected even after the conversation. Example:
Code: Select all
bool isSelected = false;
void Selected() // <-- Assign to Usable's OnSelected() event.
{
isSelected = true;
canTalkIcon.SetActive(true);
}
void Deselected() // <-- Assign to Usable's OnDeselected() event.
{
isSelected = false;
canTalkIcon.SetActive(false);
}
void OnConversationStart(Transform actor)
{
canTalkIcon.SetActive(false);
}
void OnConversationEnd(Transform actor)
{
if (isSelected) canTalkIcon.SetActive(true);
}
Re: calling OnSelect() on ProximitySelector after the conversation?
Thanks for example! I guess that is the only way then
Re: calling OnSelect() on ProximitySelector after the conversation?
Exactly. Since it's already selected, ProximitySelector has no need to call OnSelected() again.