Signing the pact with Germany by Yugoslavia didn't take an easy path. It took months of negotiations and tweaking which finally ended up on March 25th, 1941 when the treaty was signed. Only two days later, well-known March 27th took place overthrowing the regent Pavle and bringing 17 year old King Peter to reign, at least formally. British intelligence had a high level of involvement in this event as they desperately needed more enemies of their main enemy - Hitler.
Only few decades before Serbs which constituted majority of Yugoslavian population at the time were fighting bloody war with Austro-Hungarians and Germany and it would have been quite unlikely for Serbs to take Hitler's side in the war. Weeks later Nazis bombed Belgrade and then penetrated into Yugoslavia with little or no resistance. While having great ovations while marching into capitals of Slovenia and Croatia, no such a treatment took place in Belgrade.
Once Yugoslavia was conquered by Nazis, there were many militant movements involved in the conflict. Just to name few major ones: Yugoslav Partisans, Royal Chetniks and Croatian Ustashe. As some movements collaborated with Nazis, others were fighting them, and some did both, it is hard to talk about Yugoslavia as one entity during the war.