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
-1
Question by joshmann971 · Dec 28, 2014 at 08:49 PM · cameraobjectattach

Attaching an object to a camera movement weird, Help!

So I made a gun model in Unity, and attached it to the camera, just by parenting the camera to the gun model. When i move the camera, the gun moves just fine with it. The only problem is that the way it moves is not correct. The gun does not stay in its place, it moves everywhere, and I've tried everything: scripting it on there, ravaging the internet for a solution, nothing works. Thanks!

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 JonWag · Dec 28, 2014 at 08:57 PM 0
Share

Have you tried parenting the gun to the camera ins$$anonymous$$d of the camera to the gun?

avatar image joshmann971 · Dec 28, 2014 at 09:20 PM 0
Share

no thats the opposite of what i need

avatar image Thom Denick · Dec 28, 2014 at 11:29 PM 0
Share

If you don't want the gun to move, you have to apply the movement to the camera, not the gun. Sounds like whatever movement script your using is affecting the gun ins$$anonymous$$d of the camera.

2 Replies

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

Answer by joshmann971 · Jan 05, 2015 at 11:04 PM

Nevermind I fixed it, just had to reimport the 1st person controller and somehow it fixed itself! Thanks anyways everyone.

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 kevinspawner · Dec 29, 2014 at 03:09 AM

  1. Drag and Drop your Gun Game object to the Camera.

  2. Attach the movement script to the Camera.

  3. Make sure the Gun Game object does not have nay movement related script attached to it.

  4. Check the Collision. If Both the game object have physics collider, it might cause some issues. For instance if your camera has an movement script with rigidbody and collider and if you move the camera it may collide with the gun and will cause awkward movement.

Hope this helps.

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 joshmann971 · Dec 30, 2014 at 03:09 PM 0
Share

I don't have any scripts on the gun gameobject, in the scene window it looks perfect, but on the game (when i play it) it moves funny. Still moves weirdly.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Attaching a Camera to the Player 3 Answers

How to set the position of objects on the left and right of the screen 0 Answers

Object doesn't stick on Camera right Corner?? (Basic Question) 1 Answer

Typecasting Camera to Object for ObjectField 3 Answers

How can I change camera when colliding with "X" object? 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