Jump to content

GetActivationText


Boogman

Recommended Posts

Is this how you change the text the player sees when he looks at a block.

 

I tried it but got an error: Format Exception: Input string not in a correct format.

 

using System;
using UnityEngine;

public class BlockmyElevator : Block
{

   public override string GetActivationText(WorldBase _world, BlockValue _blockValue, int _clrIdx, Vector3i _blockPos,
       EntityAlive _entityFocusing)
   {
       return "Press <{E}> to operate the Elevator";
   }

}

Link to comment
Share on other sites

Is this how you change the text the player sees when he looks at a block.

 

I tried it but got an error: Format Exception: Input string not in a correct format.

 

using System;
using UnityEngine;

public class BlockmyElevator : Block
{

   public override string GetActivationText(WorldBase _world, BlockValue _blockValue, int _clrIdx, Vector3i _blockPos,
       EntityAlive _entityFocusing)
   {
       return "Press <{E}> to operate the Elevator";
   }

}

 

It's the { } that it's upset about. You can use that if you are using the localization and the string.Format() command.

 

But since you are just returning a string, you don't need to use them.

 

return "Press <E> to operate the Elevator";

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...