Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

error CS1513 AND CS1002

Discussion in 'Scripting' started by nikatetiashvili0, Apr 17, 2021.

  1. nikatetiashvili0

    nikatetiashvili0

    Joined:
    Apr 17, 2021
    Posts:
    2
    soo there 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;

    void Start()
    {
    Cursor.lockState = CursorLockMode.Locked;
    }


    void Update()
    {
    float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime;
    float mousoY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime;

    xRotation -= mouseY;
    xRotation = Mathf.Clamp(xRotation, -90f, 90f);

    Transform,localRotation = Quaterion.Euler(xRotation, 0f, 0f);

    playerBody.Rotate(Vector3.up * mouseX);
    }
    }
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,517
    If you post a code snippet, ALWAYS USE CODE TAGS:

    How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/

    Remember: NOBODY memorizes error codes. The error code is absolutely the least useful part of the error. It serves no purpose at all.

    The important parts of an error message are:
    - the description of the error itself
    - the file it occurred in
    - the line number and character position.

    All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly.

    How to report your problem productively in the Unity3D forums:

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

    How to understand compiler and other errors and even fix them yourself:

    https://forum.unity.com/threads/ass...3-syntax-error-expected.1039702/#post-6730855