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 Stephen 1 · Dec 12, 2011 at 12:46 AM · camerarotationfps

Unity3d FPS Gun rotating on camera issue

Im having a problem with the guns in my game, as they rotate on the X axis, they tend to rotate in an orbit not following the camera. I put a video on youtube to show it

http://www.youtube.com/watch?v=X9LHxsjjEl0

this has been driving me insane........

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 Lo0NuhtiK · Dec 12, 2011 at 02:02 AM 0
Share

Thats actually kind of cool looking the way it is... Just hook some arms up to the guns so it looks like the guy is reaching up to shoot as he leans back a little, rather than the usual way of looking as if the characters arms are bolted into one position at his side as they lean back far enough to snap his spine. EDIT : also, seeing part of your script might help someone help you get it to work how you want it to.

avatar image FLASHDENMARK · Dec 12, 2011 at 05:59 PM 0
Share

The problem looks like messed up(or misplaced) pivot points. If you modeled the guns in a 3D app, make sure the model is as close to 0 0 and 0 translation as possible.

avatar image maroonrs2 · Apr 19, 2012 at 06:16 AM 0
Share

actually parent the guns in the camera. EDIT: and also you need to adjust the views of the camera. Like the viewing area. And the viewing length.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Stephen 1 · Dec 12, 2011 at 02:51 AM

there is no script...thats the kicker, the only script is the mousemove script so that i can move the camera up and down...,there is no script atm...thats the confusing part, all i have is the mouselook on the camera for the y axis and the guns are children of the camera...

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 Lo0NuhtiK · Dec 12, 2011 at 07:31 AM 0
Share

oh lol ok

avatar image ks13 · Dec 12, 2011 at 08:22 AM 0
Share

...And you wonder how it's done? It's the mouselook AND weapons being the children. Once a GameObject is attached to another GameObject, it's rotation and position is relative to PARENT. So if you move the camera the weapons will move to stay on their relative position too. Try detaching the weapons and you'll see they stop moving.

avatar image
0

Answer by drkdagron.du · Dec 12, 2011 at 05:54 PM

But if I am to disconnect the weapons from the camera, then the weapons lose there movement up and down...how should I go about fixing this? Should I change the pivot on the gun in Maya to the difference in transforms from where the camera is to the hand, so that the pivot is zeroed with the camera so it'll rotate with the camera 1 for 1?

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

8 People are following this question.

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

Related Questions

How does this first person camera script work? 0 Answers

First Person Shooter Help With Cam 1 Answer

Setting camera pitch - Never works? 0 Answers

How do I properly rotate an FPS camera with a joystick? 1 Answer

Storing camera angles for a FPS -1 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