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 LWill · Dec 18, 2013 at 08:35 PM · c#erroranimationsnpclegacy

Animations aren't found although they are attached to the object

Hello,

first I have to say I am a complete beginner in Unity. I'm in the process of learning how to animate and programm with Unity. I think the answer ia a very easy answer but I can't find it. I already read the first 2 pages on Google for it but it hasn't helped.

What I want to do: I want to programm a NPC. At the moment I'm at a very very basic level. The figure is going a pre-defined way to a table. At the table the figure stops and should pick up a cup an drink form it.

What I managed to do: - The figure is walking in all way - The figure stopps in fornt of the Table

Now my problem comes up: A script attached to the figure is calling a script attached to the cup to start an animation. This animation is the mug moving up from the table to the mouth of the figure. Parallel to it the figure should play an animation where the arm is moving with the cup up to the mouth. But all this doesn't happen. The game stopps when it should call the animation form the cup which is moving the cup up to the mouth.

alt text

When I'm attaching the animation as the default animation it says it can't find it.

But I have attached it to the cup.

alt text

How do I call the animation?:

In the script from the figure I wrote this in the Updatefunction:

 var otherGameObject = GameObject.Find("Becher2");
 var otherScript = (TasseMoovement)otherGameObject.GetComponent("TasseMoovement");
             otherScript.Tassenbewegung1();

In the script from the cup I wrote this function:

 public void Tassenbewegung1()
     {
         GameObject.Find("Becher2").GetComponent<Animation>().Play("Blendertasse");
     }


This function is in the puplic class but not in the start or update function.

I also marked all animations as legacy.

I've copied a script from a related question.

Here it is: (It is in the script form the figure and in the script from the cup included )

 public class MeshPostprocessor1 : AssetPostprocessor  //all animations marked as Legacy
 {
     
     
     void OnPreprocessModel ()
     {
         (assetImporter as ModelImporter).animationType = ModelImporterAnimationType.Legacy;
         (assetImporter as ModelImporter).materialName = ModelImporterMaterialName.BasedOnMaterialName;
     }
 }

I really have no clue what is wrong with it. Do you need anymore informations?

I'm programming in C#.

Do you now a other way of doing what I want to do? How could I call the animation from the cup while the animation from the figure is running?

Thanks in advance!

bildschirmfoto 2013-12-18 um 20.57.18.png (21.1 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

0 Replies

· Add your reply
  • Sort: 

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

17 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

Related Questions

Multiple Cars not working 1 Answer

How do I code legacy animations in wrap mode Unity C# 0 Answers

Distribute terrain in zones 3 Answers

How do I play legacy animations properly in Unity C# 1 Answer

help me please dont understand problem with animation 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