• 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 3kWikiGames · Jul 19, 2018 at 07:59 PM · animationsthird person controllerflashlightarms

[Solved!] CANT HOLD FLASHLIGHT UP?

I'm currently using the third person character controller (Ethan) and am trying to edit the animations so that he will always leave his right arm up, and will be able to control it with the right stick controller so he is always holding a flashlight up at the target, anyway of doing this simply, or will I have to edit the individual animations? I tried using this code under the update function but to no avail. Any suggestions are appreciated thanks!

 //(CODE SIMPLIFIED)
 
 public GameObject Arm;
 
 void update(){
 arm.transform.Rotate(-57.77f, -20.29f, -15.49f);
 }

alt text

EDIT: It seems that when the game is about to be ended with the play button it goes up to the position I want it at, but not while playing.

screenshot-40.png (390.9 kB)
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

1 Reply

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

Answer by Liaram · Jul 23, 2018 at 05:24 PM

The character animation system (Mecanim) allows the use of animation layers. You could make an Avatar Mask to exclude the arm. That would stop Mecanim from animating it and then you can control the arm through code. But you'd have to do some digging to figure out how exactly to do that. Sadly it's too complicated to explain in a short post.

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 3kWikiGames · Jul 23, 2018 at 05:34 PM 0
Share

You're a life saver man, ended up finding this video on youtube that helped a lot. Went into the character animations tab, and created a mask on his right arm so that the animation wouldnt affect the flashlight being held up, simple and useful.

Link: https://www.youtube.com/watch?v=1d$$anonymous$$oRECcstQ

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

88 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

Related Questions

Having trouble inserting character into existing third person character controller - How can I script it so that I can move in directions? 1 Answer

How do I use SpriteManager? 1 Answer

How to get a reference of "Animations" array? 3 Answers

[Duplicated Question] Opening multiple doors 0 Answers

Understanding issues with blender and unity? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges