Ahhh...I see. It helps when asking questions if you clarify everything in the first post. Give a pattern name and link if possible and tell us what yarn and needles you're using. It'll save a lot of trying to figure that out so we can get to the answer quicker.
Yes, the yarn can make a big difference as can needle size. If you change the yarn you need to look at the gauge numbers so they are the same or at least similar. Whether it's 50 gms or 100 gms makes no difference usually. Go by gauge (or tension).
I make a lot of hats for charity. With worsted weight yarn I usually cast on either 72 or 80 and I use a size US 7. I usually don't use a pattern, but if I do those numbers might vary a bit.