Hey guys, im scripting an Intro for a game these days, and i really have problems when it comes to my code, i’m always using multiple codes (like about 10) which makes keeping the overview pretty hard.
So the thing is i’m now trying to use as few codes as possible, and here we are, my problem:
I’m trying to get it working, that im attaching my script only to one object, but the script calls other objects to play animations, even when it’s not attached to them.
Normally I just gave everything that has to play an animation an own script and wrote
animation.Play("animationsname");
but that only works when it’s attached to the Gameobject which should “play” the animation.
So what im trying to do now is that i use one script for all gameobjects that are supposed to play animations.
so i tried this:
public var test: GameObject;
test.animation.Play("animationsname");
//In the inspector i choosed my Gameobject which has the animation "animationsname"
Unfortunately this doesn’t work, any ideas?