c# - Camera animation plays automatically? -



c# - Camera animation plays automatically? -

what trying do: have animation photographic camera supposed play when click on create button, instead of waiting me click button, photographic camera animation plays right away. have disabled "play automatically" problem still occurs. below animation components:

here code within ongui() check when button pressed :

//if create button pressed if (gui.button (new rect (screen.width * createbuttonpos.x, screen.height * createbuttonpos.y, screen.width * buttonsize.x, screen.height * buttonsize.y), createbutton)) { cam.animation.play ("createcharactercameramovement"); base1 = false; }

main photographic camera animation controller

the sec image part of mecanim. orange block default animation state. new way of doing animation, can still utilize legacy way. should able remove animator component. if cause errors, can delete default animation state (select orange block , nail delete on keyboard.)

alternatively, if utilize mecanim instead of legacy system, can remove animation component. in animator window, right click , add together new state. right click state , set default (insure in inspector has no animation clip set.) can create transition state has animation clip. (you can right click state , add together transition.)

you want add together parameter (bottom left hand corner of animator window, click +) add together trigger type (this bool true 1 frame set it, essentially.)

next need click on transition , alter utilize new trigger created.

lastly, can play animation phone call settrigger in code.

you want ensure there transition animation state default state 1 time finishes playing.

c# unity3d

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -