• 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 mastersam92 · Jul 11, 2014 at 10:57 PM · java

Weapon moves away when testing...

hey guys it would be awesome if you could help me with a slight issue.. basically i made a weapon which was a mace and just attached it to the main player camera.. i was making a animation but then when i tested it it just ended up dissapearing... well it didnt but was off the screen and in the "scene" it show the mace like away from the camera and i cant see in in the player view... any ideas? here is the script i used for the weapon damage and stuff...

 #pragma strict
 
 var TheDamage : int = 50;
 var Distance : float;
 var MaxDistance : float = 1.5;
 var TheMace : Transform;
 
 function Update ()
 {
     if (Input.GetButtonDown("Fire1"))
     {
         TheMace.animation.Play("Attack");
         var hit : RaycastHit;
         if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit))
         {
            Distance = hit.distance;
            if (Distance < MaxDistance)
            {
               hit.transform.SendMessage("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReceiver);
            }
         }
     }
 }

its not layout like shown... its in a proper scripting thing... for somereason its coming up like that

Comment
Add comment · Show 3
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 DoctorMoney · Jul 12, 2014 at 02:16 AM 0
Share

Not an answer, but I had a door that when it was used it would go into an opening animation. I used blender and didn't use any armatures to animate it and ins$$anonymous$$d just rotated it. It caused a problem in Unity like the one you're having. Are you using armatures or just rotating it?

avatar image mastersam92 · Jul 12, 2014 at 03:05 PM 0
Share

im rotating and using those arrow things to move it around to get a hitting animation i just rescripted everything and am about to test it hopefully it works ....

avatar image mastersam92 · Jul 12, 2014 at 03:06 PM 0
Share

Bored$$anonymous$$ormon it would be a pleasure if you could do that :D

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by HolBol · Jul 11, 2014 at 10:58 PM

Remove any animation component from the weapon.

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 mastersam92 · Jul 11, 2014 at 11:01 PM 0
Share

there is no animation component showing on it what should i do?

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Trouble with Time.Timescale 2 Answers

Unity Web Player and Java? 1 Answer

Unity "Unable to find suitable JDK installation" problem 0 Answers

with call a plugin java in unity for usage in a application for windows 0 Answers

unable convert classes into dex format 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