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 eaque · Aug 20, 2014 at 12:32 PM · animationanimatorthird person controller

using sample assets beta, how to add animation to the third person character?

Hi everyone,

I'm using sample assets beta as Template and i'm trying to add some animations to the already made third person character. It uses 2 scripts in csharp one "third person character" and one "thrid person user" to control the model. I changed the model, and now i'm trying to make him attack.

So i first went to the Animator and add a state called "low kick" made transitions from grounded, i created a bool called lowkick and when i check the little box my player plays the lowkick move looping it, so to me it's ok.....then uncheck the bool box in the window...

I've made a java script for the lowkick move but the console says: "there is no animation attached to the gameobject but a script is triing to access it", here is the javascript of the lowkick

 #pragma strict
 
 function Start () {
     animation["kick_22"].layer = 1
     animation["kick_22"].wrapmode=wrapmode.once;
 }
 
 function update () {
    if (Input.Getkeydown("l")){

Maybe i should create a reference to the animator in my java script???? i tried but didnt find the right words! lol I promise i've tried to find by myself since 1 week with no result!! i'm noob and not very clever obviously!!

Can somebody check the free sample assets beta scripts and give me some advice or maybe THE solution! Graphicly my little project is quite good but i need to add animation to my model and dont want to go back using a different controller or animator it looks like gta gameplay and i love it!!

thats why i need some help

many thanks in advance!

peace out

eaque

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

Answer by Ezio1302 · Jan 09, 2015 at 01:09 AM

Sorry if this question is somewhat old...

You are correct, you need to include a reference to your animator component. All you need to do is add one line:

var myAnimator : Animator;

Then you attach the script to the desired object, and drag and drop your Animator Component onto the variable.

Hope this helps!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Is it possible to use the previous animation? (not animator) 1 Answer

cannot implicitly convert type void to bool 1 Answer

Original 3rd person constroller animator settings. 0 Answers

Disable Root Motion in legacy humonoid animation 1 Answer

Prefab animation only plays on first instance 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