Error CS1003: Syntax error, ',' expected

This is my script,

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MouseLook : MonoBehaviour
{
    public float mouseSensitivity + 100f;
    public Transform playerBody;
    void Update()
    {
        float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime;
        float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime;
        playerBody.Rotate(Vector3.up * mouseX);
    }
  }

It keeps saying the error “CS1003: Syntax error, ‘,’ expected” and I have tried to search it up. What do I do?

Also, I forgot to mention, that I just started leaning C#

and these are the rules for posting code

whatever Unity keeps saying, it says for a reason and also includes the line number. why do you think we somehow know what you’re doing, better than you do?

what are we supposed to do with your error if you remove all context from it?
thankfully your code is short and the error is obvious, however.

you’re calling the method transform.Rotate with one argument, and that doesn’t exist.
hence the C# tokenizer informs you that it expects a coma after the first argument, without even trying to compile any of it.

if you’ve paid attention to the line number (and exact character as well btw) which you haven’t give us, you would see that indeed it tells you to stop imagining a method that doesn’t exist.

you can’t search for such errors btw, because it’s such a silly mistake, it’s on a level of forgetting to open the door before going through it. I don’t mean to be rude, just giving a useful comparison.

next time, please, use code tags, and pay attention to the actual place of the error, you get a complete debug trace when you click on that message. what you copy pasted here is just a human-readable description that doesn’t mean much without a context.

in other words, we see the same thing as you’re seeing.
CS1003: Syntax error, ‘,’ expected

5964895 asdfkjgjt eiwrwhf f expected

the only difference being that I half-expected that you made a silly mistake.

you know, when you see a “syntax error” – as a general rule of thumb – this means you messed up the structure of the language you’re using, the parentheses, the comas, the semicolons, or some keyword is wrongly typed, or something is amiss. there is nothing mysterious about it. try not to clutter public forums with such issues, because that’s not a real problem and it’s frankly annoying.

Sorry about that, I just put code tags.

The transform.Rotate call looks fine to me. I think the error is here:

public float mouseSensitivity + 100f;

Did you mean to put an = sign?

It would help in the future if you included the full error message, which includes a line number.

Yes, I did, that was a real dumb move from me. Sorry for not including the full error message. That was my bad. But it worked! Thanks!

yes, well, it’s a lot clearer now.
you’re right, Rotate has an optional 2nd argument.

Sorry for wasting your time.

now when I think about it, I don’t know of any construct where a coma would fix this typo.
so that’s how much syntax error descriptions are useful :slight_smile:

@joseppyt oh well, it’s not so bad, I’m just scolding you a little because the no-tags-code plagues the forum and it’s hard to believe sometimes what people expect you to read