• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by UnItYgUy123478 · Jun 26 at 04:21 AM · error-message

Hello, I made a script today but there was a CS1003 error so i would be glad if you can find the error

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

public class CameraMovement : MonoBehaviour { [SerializeField] private Transform PlayerCamera; [SerializeField] private CharacterController PlayerController;

 [SerializeField] private float MouseSensitivity = 5f;
 [SerializeField] private float MovementSpeed = 4f;
 [SerializeField] private float JumpForce = 12f;
 [SerializeField] private float Gravity = -9.81f;

 private Vector3 Velocity;
 private Vector3 PlayerMovementInput;
 private Vector2 PlayerMouseInput;
   

 // Update is called once per frame
 void Update()
 {
     PlayerMovementInput = new Vector3(Input.GetAxisRaw("Horizontal"), 0f, Input.GetAxisRaw("Vertical"));
     PlayerMouseInput = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));

     Move();
     Look();

 }
 void Move()
 {
     Vector3 MoveVector = transform.forward * PlayerMovementInput.z + transform.right * PlayerMovementInput.x;

     if(PlayerController.isGrounded)
     {
         Velocity.y = 3f;

         if(Input.GetKeyDown(KeyCode.Space))
         {
             Velocity.y = JumpForce;
         }
     }
     else
     {
         Velocity.y -= Gravity * -2f * Time.deltaTime;
     }

     PlayerController.Move(MoveVector * MovementSpeed * Time.deltaTime);
     PlayerController.Move(Velocity * Time.deltaTime);
 }

 void Look()
 {
     CamXRotation -= PlayerMouseInput.y * MouseSensitivity;
     CamXRotation = Mathf.Clamp(CamXRotation, -90f, 90f);

     transform.Rotate(0f, PlayerMouseInput.x, 0f);
     PlayerCamera.localRotation = Quaternion.Euler(CamXRotation 0f, 0f);
 }
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Caeser_21 · Jun 26 at 04:24 AM 0
Share

We need more info if you want you problem to be solved...
Like which line is the error occurring, the entire error message, etc

avatar image UnItYgUy123478 Caeser_21 · Jun 26 at 06:15 AM 0
Share

Assets/CameraMovement.cs(60,65): error CS1003: Syntax error, ',' expected

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by onetimepad · Jun 26 at 07:24 AM

PlayerCamera.localRotation = Quaternion.Euler(CamXRotation ,(comma here) 0f, 0f); I can't see CamXRotation declaration One } is missing at the end.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by UnItYgUy123478 · Jun 26 at 06:06 AM

Oh sorry the error message said Assets/CameraMovement.cs(60,65): error CS1003: Syntax error, ',' expected

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tofally · Jun 28 at 12:52 PM 0
Share

Umm, we can't see line 60.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

142 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Align Error Android APK build 2 Answers

Audio Fatal Error Crash 0 Answers

Faild to find:metroEnableLowLatencyPresentationAPI UnityEditor.HostView:OnGUI() for android platform 1 Answer

What are 'Uncaught abort(x)' errors on WebGL. 1 Answer

So I'm very new and by very new I mean just started seconds ago and this pops up"Creating Project Folder Failed!" 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges