Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

[Update] What does "Unexpected Unicode character: U+202c." mean?

Asked by
rabbi99 535 Moderation Voter
6 months ago
Edited 6 months ago

Not much to tell except that I don't know what U+202c means. This is the error: Workspace.Hall.Script:10: Unexpected Unicode character: U+202c and here is my script:

Hall = script.Parent
PrimaryPart = Hall.PrimaryPart
PrimaryPart.Position = Vector3.new(133.875, 0.063, 29.125)
hallClone = Hall:Clone()
hallClone.Parent = game.Workspace
hallClone.Name = "HallClone"
HallCount = 0

function AddHall(count)
    local positionCloneX = 133.875 - count * 112.25
    print(positionCloneX)
    HallClone.PrimaryPart
end

PrimaryPart.Touched:connect(function(hit)
    if hit.Parent == game.Players then
        HallCount = HallCount + 1
        print(HallCount)
        AddHall(HallCount)
    end 
end)

Keep in mind that this script is just a draft and not complete.

I think I do the math wrong, after all I feel really dumb for not knowing this.

Every answer counts! Thank you

Edit: After a little research, I found out that U+202c is -. So, my question has changed: How does one subtract in scripting. I don't want a literal answer, I want it to have a connection with my script.

1
Can you tell us what print(HallCount) prints? mixgingengerina10 208 — 6mo
0
I don't know because that error keeps stopping the script. rabbi99 535 — 6mo
1
Oh right, let me see what I can do. mixgingengerina10 208 — 6mo
1
Okay so, I found out that "-" = U+202c rabbi99 535 — 6mo

2 answers

Log in to vote
1
Answered by
eLunate 5112 Trusted Moderation Voter Community Moderator
6 months ago

Unicode control characters

U+202c is the control character Pop directional formatting which could be inserted if you have a language or input configuration which typically depends on right-to-left formatting such as Arabic scripts.

Using - is the correct way to subtract, and the U+202c control character is typically invisible. Ensure that you're using only left-to-right input methods when writing your scripts.

0
I am writing it in English (United States). rabbi99 535 — 6mo
0
Do you have alternative input methods configured? eLunate 5112 — 6mo
0
So if - is the correct way to subtract, why won't it work on my script. rabbi99 535 — 6mo
0
As it's entirely possible you accidentally inserted a control character with an alternative input method whilst typing. eLunate 5112 — 6mo
View all comments (6 more)
0
I will try copy and paste that dash in my script. Maybe that'll work. And no, I'm just using a plain keyboard without any other special additions. rabbi99 535 — 6mo
0
And you don't have alternative inputs configured in your OS? eLunate 5112 — 6mo
0
It is still not working. rabbi99 535 — 6mo
0
Cool, that means the issue isn't the dash. You're welcome. Delete the entire line and rewrite it by hand to ensure that you've cleared the control character. eLunate 5112 — 6mo
0
Nope, just 1 input. rabbi99 535 — 6mo
0
Is the problem resolved? mixgingengerina10 208 — 6mo
Ad
Log in to vote
0
Answered by
KBRM101 383 Moderation Voter
6 months ago

Your math is incorrect. You need to add parenthesis in order for your program to run. Your options are:

local positionCloneX = (133.875 - count) * 112.25

And

local positionCloneX = 133.875 - (count * 112.25)

I assume you want to use the first option because of how your code was originally formatted. I hope this solves your problem.

0
Oh, that's required? I will try! rabbi99 535 — 6mo
0
Same error. Not working :( rabbi99 535 — 6mo
0
Are your sure you're writing the subtract sign in english language and not any language? mixgingengerina10 208 — 6mo
0
I am writing it in English (United States) rabbi99 535 — 6mo

Answer this question