Henryos
New member
Hello!, I'm trying to display a message when the player can interact with a Door,
So I have my door script that is something like this:
But the problem is that the message doesn't appear.
So I went to the Interact.cs script and changed this
for this:
And now is working!!, but to be honest I don't want to change the source code of your asset to make it work.
So I wanted to know if this is a bug or there is something that I'm not getting about the working of AbilityMessage.
Thanks in advance!!
So I have my door script that is something like this:
Code:
public class hp_DoorMovement : MonoBehaviour, IInteractableTarget, IInteractableMessage
{
public bool CanInteract()
{
return true;
}
public void Interact()
{
Debug.Log("Interact!")
}
public string AbilityMessage()
{
return "Use Door";
}
}
But the problem is that the message doesn't appear.
So I went to the Interact.cs script and changed this
Code:
public override string AbilityMessageText
{
get
{
var message = m_AbilityMessageText;
if (m_Interactable != null) {
message = string.Format(message, m_Interactable.AbilityMessage());
Debug.Log(message);
}
return message;
}
set { base.AbilityMessageText = value; }
}
for this:
Code:
public override string AbilityMessageText
{
get
{
if (m_Interactable != null) {
return m_Interactable.AbilityMessage();
}
}
set { base.AbilityMessageText = value; }
}
And now is working!!, but to be honest I don't want to change the source code of your asset to make it work.
So I wanted to know if this is a bug or there is something that I'm not getting about the working of AbilityMessage.
Thanks in advance!!