Assets\MouseLook.cs(29,62): error CS1003: Syntax error, ',' expected

Im new to unity and I used this script and this error poped up

Assets\MouseLook.cs(29,62): 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;
float xRotation = 0f;
// Start is called before the first frame update
void Start()
{
Cursor.lockState = CursorLockMode.Locked;
}
// Update is called once per frame
void Update()
{
float mouseX = Input.GetAxis(“Mouse X”) * mouseSensitivity * Time.deltaTime;
float mouseY = Input.GetAxis(“Mouse Y”) * mouseSensitivity * Time.deltaTime;
xRotation -= mouseY;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
transform.localRotation = Quaternion.Euler(xRotation 0f, 0f);
playerBody.Rotate(Vector3.up * mouseX);
}
}

Please tell me how I can fix this.

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

Please use code tags: Using code tags properly

Assets\MouseLook.cs(29,62) → The compiler encountered an error at this file: Assets\MouseLook.cs, at this position (line, column): (29,62)

Syntax error → something is wrong with how the code is formatted.

',' expected → The compiler was expecting a comma at this location but didn’t find one.

On line 29, you forgot a comma between xRotation and 0f:

transform.localRotation = Quaternion.Euler(xRotation 0f, 0f);

Please do not continue this thread as it’s a duplicate of this one . A moderator may be able to delete this one or at least lock it. If you want to add or comment on something related to this thread, do it on the other one.

1 Like