I’ve noticed an issue recently where the ∞ will become a “?” for some reason and I’m not sure why, as it had worked just a couple months ago. It’s quite annoying because I want the Infinity symbol to show up when you have a weapon with infinite ammo (in this case, the plasma pistol. However, recently, it’s begun to not display properly and I’m not sure how to fix it.
Code:
script.Parent.HUD.AMMO.AmmoLabel.Text = "∞"
It should be noted that putting the ∞ in the script turns it into a ? and I’m not sure why.
I can’t seem to repro this, I first put “∞” into a SurfaceGui TextLabel, that worked fine, then tried running your code from the command line, and the TextLabel showed “∞”, then tried running a server script, and the TextLabel showed “∞”. I even saved the place and re-opened it, the “∞” in the script was not a ?, and it still worked on the TextLabel.
I’m not sure what you mean by ‘will become a ?’, but if you mean in the script editor, and not the TextLabel itself, this is likely due to your font not having an infinity symbol, not due to a Roblox bug.
It literally just writes the “∞” symbol to the text label by taking the unicode decimal value 8734 (character value U+221E) and converting it to a character.
Can you provide exact steps to reproduce this? There should be no case where that happens. I’m not able to reproduce it locally as you’ve described.
How are you inputting the symbol? Are you pasting it in, typing it with an alt code, or using a special keyboard layout or IME?
Is there anything else we should know about your PC, like what language it’s set to, what OS you’re using, and so on.
By your description, it sounds like immediately upon typing it into the script editor it becomes a ? instead of the symbol. Nothing to do with TextLabels specifically. Is this right?
If I paste the infinity symbol into the text label, it renders perfectly fine.
The moment i paste it into the script, exit the script, and re-open it, the infinity symbol becomes a question mark.
I’ll see if I can get a reproduce for you.
I’m running Windows 10 Home, 64 Bit. It’s set in English, etc. etc.
Is this an issue with a unicode setting in Studio perhaps?
It doesn’t bug out if the script is local - however, if it’s a linked source, that’s when the bug occurs.
EDIT: This would explain why ever since I transitioned my framework from Embedded to Linked Source, caused the ? to appear while the Embedded script still retained the ∞.
I’m able to repro that case as well. I also noticed that plugins loaded from a .lua file will load with the same issue, but rbxm/rbxmx shouldn’t be affected.