Search Unity

21,83: error CS1002: ; expected (FIXED)

Discussion in 'Scripting' started by not_log1c, Nov 7, 2020.

  1. not_log1c

    not_log1c

    Joined:
    Feb 14, 2020
    Posts:
    3
    So i got 2 errors
    (21,83): error CS1002: ; expected
    and
    (22,83): error CS1002: ; expected
    I found an a script from youtube (because im new to unity) which doesn't work and in this video person was explaining if the script doesn't work you will need check the new input system but i don't know how to even script...
    Here is an a script:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class MouseLook : MonoBehaviour
    {

    public float mouseSensitivity = 100f;

    public Transform playerBody;

    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
    float mouseX = Input.GetAxis("MouseX") * mouseSensitivity * Time.deltaTime
    float mouseY = Input.GetAxis("MouseY") * mouseSensitivity * Time.deltaTime

    playerBody.Rotate(Vectpr3.up * mouseX);
    }
    }

     
  2. not_log1c

    not_log1c

    Joined:
    Feb 14, 2020
    Posts:
    3
    Had error at line playerBody.Rotate(Vectpr3.up * mouseX); but fixed it so dont say that i wrote it wrong
     
  3. not_log1c

    not_log1c

    Joined:
    Feb 14, 2020
    Posts:
    3
    Actually fixed whole script now