Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by 017Bluefield · Sep 20, 2019 at 06:40 AM · scripting problemvisual studioplaymodecompiler errorconsole errors

Missing type/namespaces do not allow me to playtest?

Main problem: A first-person combat prototype that I'm working on has run into a snag. Some of the names that I'm using in a script are stopping me from playtesting the game. The script in question is a Weapon.cs script that's based on the Creator Kit: FPS project's own script of the same name. I'm using this script to separate the weapon/ability scripting from the player movement control of the FPSController.cs script.


Aside: I am currently using Visual Studio 2019, which...the current version that I have seems to be missing something vital to Unity development, because it's missing some of the namespaces that I need for Unity C# scripting.


Current Weapon.cs script (based on Creator Kit: FPS):

 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using UnityEngine;
 using UnityEngine.Serialization;
 using UnityEngine.UI;
 #if UNITY_EDITOR
 using UnityEditor;
 #endif
 
 public class Weapon : MonoBehaviour
 {
     static RaycastHit[] s_HitInfoBuffer = new RaycastHit[8];
 
     public enum TriggerType
     {
         Auto,
         Manual
     }
 
     public enum WeaponType
     {
         Raycast,
         Projectile
     }
 
     public enum WeaponState
     {
         Idle,
         Firing,
         Reloading
     }
 
     [System.Serializable]
     public class AdvancedSettings
     {
         public float spreadAngle = 0.0f;
         public int projectilePerShot = 1;
         public float screenShakeMultiplier = 1.0f;
     }
 
     public TriggerType triggerType = TriggerType.Auto;
     public WeaponType weaponType = WeaponType.Projectile;
     public float fireRate = 0.5f;
     public float reloadTime = 2.0f;
     public int clipSize = 9;
     public float damage = 1.0f;
 
     [AmmoType]
     public int ammoType = -1;
 
     public Projectile projectilePrefab;
     public float projectileLaunchForce = 200.0f;
 
     public Transform EndPoint;
 
     public AdvancedSettings advancedSettings;
 
     [Header("Audio Clips")]
     public AudioClip FireAudioClip;
     public AudioClip ReloadAudioClip;
 
     [Header("Visual Settings")]
     public LineRenderer PrefabRayTrail;
 
     [Header("Visual Display")]
     public AmmoDisplay AmmoDisplay;
 
     public bool triggerDown
     {
         get { return m_TriggerDown; }
         set
         {
             m_TriggerDown = value;
             if (!m_TriggerDown) m_ShotDone = false;
         }
     }
 
     // Start is called before the first frame update
     void Start()
     {
         
     }
 
     // Update is called once per frame
     void Update()
     {
         
     }
 }
 
 //public GameObject shot;
 //public Transform shotSpawn;
 //public float fireRate;
 
 //private float nextFire;
 
 //if (Input.GetButton("Fire2") && Time.time > nextFire)
 //{
 //    nextFire = Time.time + fireRate;
 //    Instantiate(shot, shotSpawn.position, shotSpawn.rotation);
 //}


Console log:

These names are apparently nowhere for Unity to find?

playtest-stopping-errors.jpg (104.1 kB)
Comment
Add comment · Show 5
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 xxmariofer · Sep 20, 2019 at 08:12 AM 0
Share

do you have the scripts that are missing? or you only copied that script?

avatar image 017Bluefield xxmariofer · Sep 22, 2019 at 03:52 AM 0
Share

I'm adding from the $$anonymous$$it's script piece by piece, but I'm not sure if I understood the question. What would either case mean for the project?

avatar image xxmariofer 017Bluefield · Sep 22, 2019 at 06:18 AM 1
Share

All the ammo classes are missing in your project so you skipped when they add It in the tutorial

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

269 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 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

Visual Studio 2017 and Unity 2019 not communicating? 1 Answer

Finishing up my 2D quiz game [Last Problem] 0 Answers

Miscellaneous File On All My Scripts 1 Answer

I am getting a CS1504 error in Unity,I am getting a CS1504 error 0 Answers

Unity 5 checking if player isGrounded 1 Answer


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