Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
4
Question by Xdy · Jun 23, 2013 at 01:22 PM ·

The namespace `global::' already contains a definition for `ShooterGameCamera'

error at line "public class ShooterGameCamera : MonoBehaviour {" this is upper part of script ShooterGameCamera.cs taken from 3rdpersonshooter unity demo game

using UnityEngine; using System.Collections;

 // 3rd person game-like camera controller
 // keeps camera behind the player and aimed at aiming point
 public class ShooterGameCamera : MonoBehaviour {
     
     public Transform player;
     public Transform aimTarget;
     
     public float smoothingTime = 0.5f;
     public Vector3 pivotOffset = new Vector3(1.3f, 0.4f,  0.0f);
     public Vector3 camOffset   = new Vector3(0.0f, 0.7f, -2.4f);
     public Vector3 closeOffset = new Vector3(0.35f, 1.7f, 0.0f);
     
     public float horizontalAimingSpeed = 270f;
     public float verticalAimingSpeed = 270f;
     public float maxVerticalAngle = 80f;
     public float minVerticalAngle = -80f;
     
     public float mouseSensitivity = 0.1f;
     
     public Texture reticle;
     
     private float angleH = 0;
     private float angleV = 0;
     private Transform cam;
     private float maxCamDist = 1;
     private LayerMask mask;
     private Vector3 smoothPlayerPos;
     
Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
15

Answer by RalphTrickey · Jun 23, 2013 at 01:40 PM

It means exactly what it says. Somewhere in your source files (or a third party library) you have a class called ShooterGameCamera.

The simplest thing to do is to rename your class, although it may be worth finding out where else you have that class declared.

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 nubhokage1991 · Oct 14, 2017 at 05:05 AM 0
Share

This reply helped me also. Thanks a lot

avatar image
0

Answer by ahmedaniss · Jun 14, 2021 at 10:23 PM

Problem Fixed here : https://youtu.be/28n9q8GG-gg

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 terresquall · Apr 19 at 08:23 AM

Or if you prefer to read, you can check out this article here, which goes through a few possible causes of the error and how to fix each of them: https://blog.terresquall.com/2021/10/the-global-namespace-already-contains-a-definition-for/

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

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.

Follow this Question

Answers Answers and Comments

21 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

Related Questions

how do I fix following errors? help please 1 Answer

Necessary to remove unused scripts from imported packages for deployment? 1 Answer

The type or namespace name `Web' does not exist in the namespace `System' 3 Answers

error CS0101 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