Animation unexpected behaviour - Why animation bec

2019-07-22 11:27发布

问题:

Maybe what I am going to ask you is unbelievable but It is my observation of Three days. I am unable to figure-out what is the problem. I have asked my problem three times in different perspective but no luck.

Different but some kind (train) animation runs at once on button click some animation complete on time while some not(play continuously-Don't know why). If I move my camera in the scene (a place where animation have to reach) then, my animation become complete but if I don't move or turn my camera then animation not complete even half hour passed. I don't know what is the relation between camera and animation completion. some things which I want to know

  1. Why some animation complete on button click while the some not, even the code is same and animation clips are right
  2. Why those animation who play continuously, becomes complete as i walk thorough my camera
  3. What is relation b/w camera and animation play?
  4. Is Train culling is the problem because i note that if i don't use the culling then, this problem occurring less(But occurring) as compare to train with culling.

回答1:

Refer to my this question and answer. It were much disappointing that no one able to identify the problem (maybe lack of much attention to this question). After working 4/5 days finally I got this.

It were mainly animation Culling type Problem. For future use and help for the beginners like myself I am going to answer my own question here all questions are tightly associated with each other i.e., 1 answer to understand it:

Answer:

My animation culling type were selected to BasedOnRenderers which means that 'Animation is disabled when renderers are not visible'. i.e., my code were showing me that animation is playing but nothing acutal happening in my scene as my animation were far from camera view.

I solved this problem by selecting animation culling type to AlwaysAnimate (refer to this). It means that 'object is animated even when offscreen'.

Hope it will help others