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 artician · Jun 14, 2010 at 08:44 PM · characterjoystickboneskeleton

How do you 'get' specific bones in a character skeleton via script.

Hello! How are you?

I would like to know more about targeting specific bones on a character model via script.

I have a character I am controlling with a dual-stick controller. The right stick walks the character around, while the left stick turns the upper body.

I know I can create a simple 'lookat' script and place it directly on the bone I want to turn (in this case, the first spine bone above the pelvis). However I would like to keep the character controls in a single script, currently located on the root node of the overall character, and simply call out to the correct bone from it.

I am a new programmer so apologies if this is more of a general programming question and not specific to Unity. I still greatly appreciate any help though! Thank you in advance!

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
4
Best Answer

Answer by Jessy · Jun 15, 2010 at 01:37 AM

Bones are just Transforms in Unity, so all you need to do is create a variable, then drag the correct Game Object onto the variable slot in the Inspector.

var bizzyBone : Transform;

You can then script anything you want with that Transform, and the Skinned Mesh Renderer's vertices that are weighted to that bone will go along for the ride (forward kinematics).

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 artician · Jun 15, 2010 at 03:07 PM 0
Share

Thank you very much!

avatar image SinisterRainbow · Nov 24, 2013 at 05:37 AM 0
Share

I always wondered when someone would make a Bone Thugs reference.. nice.

avatar image
0

Answer by Tetrad · Jun 14, 2010 at 10:56 PM

Check out the head look controller

http://unity3d.com/support/resources/unity-extensions/head-look-controller

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 artician · Jun 15, 2010 at 12:38 AM 0
Share

I did! It's in C#! Is there a Java Script equivalent? I don't feel like it's a good idea to switch languages when I'm just getting the hang of the first one... I've compared the two and I'm unable to parse the latter. :( Thank you though!

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

1 Person is following this question.

avatar image

Related Questions

Is there a limit to the number of bones in a model 2 Answers

AnimationState.AddMixingTransform 1 Answer

Swap mesh parts i.e. attach one skinned mesh to another via bone 1 Answer

Basic Character Transform with Joystick 1 Answer

joystick left right problem unity 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