I made a simple animation in 3DS Max and now I am fiddling around with it in Unity, but I do not know how to do any scripting at all. I’ve been trying to look up info on how to accomplish my goal but I am not having any luck.
I split my animation with the FBXImporter, but I still need to know how to make each animation begin on separate mouse clicks. Would it begin like this:
function OnMouseClick (0){
}
As for the in between part, I’m not sure of the wording. Would it be:
play.AnimationClip "(name of 1st half of animation)";
if mouseclick (0)(play.AnimationClip "(name of 2nd half of animation)";
else AnimationClip = idle;
Do I even need the conditional part or will it remain idle on it’s own until the next mouse click?
You don’t need the conditional part, no, but if you only want it to play while the mouse is held down, you’ll need something in its place.
Generally, you are going about this the wrong way. You should put this stuff in your Update function, and then use the Input class to determine whether you are clicking. Also, you are thinking of animation.Play, not play.AnimationClip- the correct syntax for playing an animation is
As for syntax and general scripting, you can learn about this stuff by looking through the script reference! There are working, copy-pastable examples on almost every page, for every function imaginable. Several examples for the important ones! Start there, before coming to this site for specific code problems.