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 bundy2k6 · Apr 19, 2013 at 10:16 AM · animationtriggerdeathkill

Death and animations

Quick question guys in relation to triggering an animation after death. I am using the 3rd person controller that comes with unity for character control.Everything is set up and working fine but there is no death animation if the player is destroyed. I have one ready to go I just need to know how to call it from the script. I found the animation.play tutorial on untiy's scripting reference site but don't really get how to implement it. Any help much appreciated!

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
0

Answer by cowasockytommy · Apr 19, 2013 at 10:26 AM

animation.CrossFade("name of animation");

Comment
Add comment · Show 24 · 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 bundy2k6 · Apr 19, 2013 at 10:34 AM 0
Share

Hey cowasockytommy! Cheers for the reply! Just wondering where I would put this line? Does it do into my 3rd person controller script? And if so do you know where? Completely new to this, learning as I go!

avatar image cowasockytommy · Apr 19, 2013 at 10:37 AM 0
Share

well it depends. basicly you only have that script right?

avatar image cowasockytommy · Apr 19, 2013 at 10:38 AM 0
Share

but yes most likey in your 3rd person controller script is where it would go

avatar image cowasockytommy · Apr 19, 2013 at 07:45 PM 1
Share
     function OnTrigerEnter(oth: Collider)
     {
         if(oth.gameObject.tag == "")
         {
             animation.Play("");
             yield WaitForSeconds(2);
             Destroy(gameObject);
         }
     }
     
     //did you give the enemy a tag?
     and here i did this in java script no errors for me
     i did some changes
avatar image cowasockytommy · Apr 19, 2013 at 09:54 PM 1
Share

let me know if you got it working :)

Show more comments

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

12 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

Related Questions

Kill enemy when animation is playing 1 Answer

How do I call a death animation and die audio 0 Answers

How do I make the enemy ai animations play after the player exit the on trigger collider on the enemy ai 0 Answers

Play parent animation without affecting the child animation 1 Answer

Please help in triggering an animation through another object. 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