Keeping Dynamic Text Constrained To a Text Box

Hello, I am new to the game engine in blender and have been working on a short game to improve my skills. I created a seperate scene and overlayed it. This new scene will contain the objectives and will update as the games goes along. I setup text with a string variable and it works whenever I change the variable but is not contained within the text box. How do I get around this?

You probably want to wrap the text at a certain character limit.
This will make it so that after a line exceeds a given number of characters (Ex: ‘a’ ‘b’ ‘2’ etc.) any more words in that line will be moved to the next line.

Try different character limits until you find one that keeps all of the text within your textbox.

For example, my game uses the following module to wrap text: