Search Unity

Question Code error

Discussion in 'Getting Started' started by CarmonaGames, Feb 15, 2024.

  1. CarmonaGames

    CarmonaGames

    Joined:
    Feb 15, 2024
    Posts:
    2
    I keep getting this error and I don´t know what is wrong:

    Assets\Scripts\CameraMovement.cs(8,30): error CS1003: Syntax error, ',' expected

    Any help please?

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class CameraMovement : MonoBehaviour
    6. {
    7.     public Transform cam;
    8.     public float sensitivity 100.0f;
    9.  
    10.     void Start()
    11.     {
    12.        
    13.     }
    14.  
    15.     void Update()
    16.     {
    17.  
    18.         float mouseX = Input.GetAxis("Horizontal") * Time.deltaTime;
    19.  
    20.         cam.Rotate(Vector3.up * mouseX * Time.deltaTime * sensitivity);
    21.  
    22.     }
    23. }
     
  2. CarmonaGames

    CarmonaGames

    Joined:
    Feb 15, 2024
    Posts:
    2
    Nvm, I´m stupid, I missed the =
     
  3. Nad_B

    Nad_B

    Joined:
    Aug 1, 2021
    Posts:
    731
    Not stupid, just inexperienced. We all have been there.
     
    MCF24 likes this.