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 /
avatar image
0
Question by lluiscolom8 · Nov 07, 2017 at 02:48 PM · unity 5

Camera and character control

Hi, I'm creating a fps. I've been adding a script to my character that allows it to move and another that make my character turn in the X axis, all of this is fine.

Now my problem is that, when I add script to make the camera (attached to the body, in a way what in run-time you see the arm and the weapon (like in cod)) to turn in the Y axis, only the camera moves, and the character arms rest in the same position.

I don't know if I'm clear. When I turn my character to the right or left, all is good, but when it looks up or down, only the camera moves, not the arms. How could I fix that?

One solution could be to split the character in 2 parts: 1 the body and the other one the arms, but then I don't know how could I animate both body and arms.

ty

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by TanselAltinel · Nov 09, 2017 at 02:50 PM

Hi lluiscolom8,

Your problem here is hierarchy. When you move the character around X axis, whole character object rotates. Thus, every child object under character object rotates relatively.

However when then you move only camera and everything under only camera will rotate. So, you'll have to move your arms and weapons object under the camera, so they will rotate with camera too.

Comment
Add comment · Show 4 · 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 lluiscolom8 · Nov 10, 2017 at 04:13 PM 0
Share

@TanselAltinel Hi man thanks for replying. $$anonymous$$ore or less I understood you, but my question is deeper. It's going to be an online game so other players should be able to see your character move relatively your actions. So if you aim up, the character arms should rotate up too, like in real life. How could I get this? $$anonymous$$aking animations of ai$$anonymous$$g top, ai$$anonymous$$g down...?

avatar image TanselAltinel lluiscolom8 · Nov 11, 2017 at 12:35 AM 0
Share

Are you using a full body animation ins$$anonymous$$d of just hands?

If so, you'll need to use I$$anonymous$$. There are a few solutions in the asset store like UFPS and Final I$$anonymous$$, you should check them out.

avatar image lluiscolom8 TanselAltinel · Nov 11, 2017 at 09:26 AM 0
Share

Yes, I have a full body that should be animated. For this reason I ask you:

Should I split my mesh into two parts: one for the body and another one for the arms, and animate them separately? By this way I suppose it will work.

If you have another method to make it, let me know.

Show more comments
avatar image
0

Answer by Rugbug_Redfern · Nov 10, 2017 at 06:09 PM

Make the arms or anything you want to move with the camera a child of the camera. If you want to make it multiplayer compatible (with UNet) you can just add a network transform to the player's root and the transform and all it's children should sync.

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 lluiscolom8 · Nov 11, 2017 at 09:26 AM 0
Share

Yes but the body and the arms are 1 thing, so I can't make only the arms move, because the body will follow the camera too. For this reason I ask you:

Should I split my mesh into two parts: one for the body and another one for the arms, and animate them separately? By this way I suppose it will work.

If you have another method to make it, let me know.

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

146 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

Related Questions

Add prefabs to hierarchy without game running? 1 Answer

Gradle is failed to fetch dependencies , admob ,in UNITY console , Gradle failed to fetched dependencies 3 Answers

Why is this happening? 0 Answers

Unity 5 Multiple Screen Space Overlay Canvas issue 0 Answers

GetKeyDown held for too long 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