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
0
Question by Sangre Aeterna · Jul 09, 2014 at 11:55 PM · playercombinematch

Unable to Attach to Player but Public Class and File Name Match

Just what it says up there. I even changed the class name and the file name in a new copy and it's still kicking it back to me. As you can see I've tried rewriting things from scratch, even loading the finished script from the tutorial I was following. All to no avail.

alt text

Thanks a ton in advance!

Update: I found some JavaScript code that should do the same thing my C# code does. I imported it to see if I could work around whatever's happening. Same error.

alt text

screenshot 2014-07-09 18.44.24.png (135.7 kB)
screenshot 2014-07-09 20.40.07.png (130.5 kB)
Comment
Add comment · Show 9
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 DoctorWho · Jul 10, 2014 at 12:09 AM 0
Share

how did you bring this into unity to start, if you used click drag in windows file view unity will not except that, because it has a built in asset tracker, you must use its importer. or use your default editor to make it. by first choosing create new script.

avatar image Sangre Aeterna · Jul 10, 2014 at 12:32 AM 0
Share

I tried dragging it in, and I imported it with Asset importing, but more importantly I wrote the original script (FPS) after choosing New Script. Gave me the error message the first time, and every time after.

avatar image SirCrazyNugget · Jul 10, 2014 at 12:42 AM 0
Share

If you've had any errors in your code adding new files are unable to be placed on objects until they have been fixed. From the look of the screenshot this may be the case but it's not possible to see what that error is

avatar image Sangre Aeterna · Jul 10, 2014 at 12:45 AM 0
Share

Alright. Do you mean errors as in grammatical issues in presently attached code or something else. Do you mean it's not possible to see from the pictures, or that it's just not possible and I'll have to fumble around in the dark until I find it.

If it's the former, and I'm hoping it is, how do I find the error?

avatar image meat5000 ♦ · Jul 10, 2014 at 12:51 AM 0
Share

@DoctorWho Dragging in to the project in Windows Explorer works fine for me. In fact its the only method I use to update my FBX files, so as to avoid having to re-setup. Unity likes to make duplicates.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by DoctorWho · Jul 10, 2014 at 02:24 AM

 #pragma strict
 
 var Bullet : Rigidbody;
 
     function Update () {
         // Ctrl was pressed, launch a projectile
         if (Input.GetButtonDown("Fire1")) {
             // Instantiate the projectile at the position and rotation of this transform
             var clone : Rigidbody;
             clone = Instantiate(Bullet, transform.position, transform.rotation);
 
             // Give the cloned object an initial velocity along the current 
             // object's Z axis
             clone.velocity = transform.TransformDirection (Vector3.forward * 10);
             // destroys the object after a time
             Destroy (clone.gameObject, 5);
         }
     }
Comment
Add comment · Show 2 · 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 DoctorWho · Jul 10, 2014 at 02:48 AM 0
Share

you can still use the" (Input.Get$$anonymous$$ouseButtonDown(0));" ins$$anonymous$$d of if (Input.GetButtonDown("Fire1"))

avatar image DoctorWho · Jul 10, 2014 at 03:01 AM 0
Share

let us know what you think if this salves it for you, and so on. that way we will know if it was code or something else messing up.

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

6 People are following this question.

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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

WheelColliders Bug Fix 0 Answers

C# Script is affecting multiple GameObjects but I would like it to only affect one of them... 1 Answer

How To Make Enemy Chase You? 1 Answer

How would I go to add the Players Voice in the game? 2 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