Place text next to last character

Hi there

I’m using Legacy Text from Unity because my project is very old and I don’t want to mess up,

So, I want to place a text next to other text at the last character

such as

Place text2 next to text1, But place at the last character of text1

is this possible?

Thanks!!!

You want to combine just the strings or two whole Text game objects? Please describe in more detail.

For the first: How to insert one string into another using Insert() in C# (educative.io)

For the later: I imagine you would need to define a length for each character (because some are wider than others: - i u l m n j / : ~ 1 3 ) and then run a loop through this string and add the corresponding length to a total variable. At the end you have the correct length of your text and you can now position the Text2 object at the Text1.position.x + the total length of the characters.

1 Like

If you want to use anchors, you can use this component on your first Text object:9236796--1290543--upload_2023-8-20_20-2-3.png

And then have the second Text object anchored to the left:
9236796--1290546--upload_2023-8-20_20-3-23.png

Place the X pivot at the left so its easier to control

1 Like

Thank you very much!!!