Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

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

$
0
0
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][1] 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][2] 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().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#. Thanks in advance! [1]: /storage/temp/19514-bildschirmfoto+2013-12-18+um+21.13.38.png [2]: /storage/temp/19517-bildschirmfoto+2013-12-18+um+20.57.18.png

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>