read through this to help with the disassembly (note: I just googled "STAR M4 disassembly" and it came up as one of the first couple of hits)
You'll note that the hopup is locked into the mechbox (which is a common Star thing). It makes it a bit of a juggling act to take apart.
Things to check:
1. with the hopup+inner barrel out...look down it from the chamber end and see that the nub is centered. As you adjust the hopup, the nub should stay centered and just protrude more or less into the barrel. Rotate the inner barrel just a bit and gently (or you'll crack parts of the hopup) to get it centered. If it doesn't look even, then you might want to disassemble the hopup and check out the nub and the rubber to see if everything looks good and isn't torn/mangled.
2. If your inner barrel is bent you'll get wonky shots...rare, but it can happen, especially if some 'tard tossed this gun together. Same with nicks/gouges/dents. Gotta swap inner barrels if this is the case. Great time to really clean the barrel out in case there's gunk caked in it.
3. The inner barrel might be straight...but not in line with the outer (the outer might be crooked on the receiver as well). Hopefully it's not so lousy that it's clipping the barrel. You can help center the inner with the outer by wrapping a bit of tape around the inner barrel...or putting on a o-ring if you can get one to fit (sometimes you can see if it's way off center by looking down the muzzle end...just make sure your battery is unplugged first!!)
4. Are you getting the velocities you should be? If you're shooting really weak it might shoot but only be going 100fps.
If that's all good...then it should be shooting straight. 20ft isn't far enough for the hopup to kick in (35-40'+)...but you should be able to get your sights close. Put the hopup on half way (that's just a wild ass guess because there's so many variables)...if you get a jam (i.e. it shoots and sounds muffled) drop the mag, back the hopup off a bit and dry fire the jam out.
Does your rifle even shoot a tight-ish group? Regardless of point of impact vs. point of aim...does your rifle put consecutive shots in some predictable pattern? If it's placing shots randomly in the area the size of your hand at 20' forget trying to sight in and take a better look at tightening up the group first.
If you are aiming right...you're looking through the peep rear sight and can "see" the post up front. You shouldn't be able to see the peep rear sight...since it's so close to your eye and you're looking at the front post...it should just be fuzzy with a nice clear spot in the middle. The peep rear sight will naturally center your eye. You should be able to see the tip of your front post clearly...if it's blury, reposition your head until you can see it. The target will be fuzzy too. Alternate focus between the post and the target.
Aim the tip of the post to the center of your target....at 20ft a solid black dot the size of a tooney is easy to see. If you're near blind
...then use a drinking cup to draw a circle and colour it in...but then aim for the 6 o-clock bottom of the circle for a better aiming reference point. If you're all shaky at holding a rifle or yank on the trigger...a good improvised rest is a regular armless chair with some rolled up towels on the seat. Ideally you want to be able to aim, shoot the rifle (thankfully there's no recoil with AEGs so you don't have brace that) and adjust the sights without disturbing the position of the rifle. This sounds easy but it's not. With an AEG, once it's aimed you don't even need to be touching anything but the trigger when you shoot it.
Aim at center. Shoot 3-5 shots. Where does it impact? If it's "low and to the left"...then adjust your rear sight to the right. Over adjust...and if it's too much you'll have a sense for how much to move it back after you take 3-5 more shots. At 20' you should be shooting nice tight-ish groups...you should be able to clearly see the "center" of your group.
If you've really got your rifle "benched" then you should be able to gently adjust your rear sight and see the POA move over to be inline vertically with the POI of the group that you just shot. Not as easy to do with iron sights, but not too hard to do with optical sights. With a good setup, and a very accurate rifle you should be able to take one shot and then adjust windage/elevation to put your POA over the POI....and the next shot should be very close to the first one. But airsoft AEG stuff is rarely that accurate/repeatable.
Don't adjust both windage and elevation at the same time...just do one or the other. Group shooting to the left (Point of Impact...POI) of point of aim (POA) then move rear sight to the right. POI is to the right of POA, move rear sight to the left.
Once you've got windage set...then work on elevation. Screw the front post in (make it lower) to raise the POI...POA is still center of target. Unscrew it (make it taller) to lower POI. At 20'...you'll probably want to set your POI about 1-1.5" above your POA....then readjust it once you can get outdoors and set the hopup and rezero your sights...but it should be at least close then.
If you've maxed out the windage of your rear sight and it's still way off to one side or the other...take a look under the front sight and see if there is a little grub screw. Loosen it and rotate the front sight a bit (looking from the rear of the rifle...tilt it to the right to shift POI to the right...and vice versa). Even with the two cross pins, there should be a little bit of play. Actually you might be best off centering your rear sight and doing this first to get close.
If you've maxed out your elevation and are going to stick with iron sights...then your options are to:
1. Switch front sights and hope for the best
2. Remember some other aiming point on the post (i.e. the top of the threaded section)
3. Grind down the post (sometimes it's better to grind down the bottom of the threaded portion and other times it's better to grind down the post...and sometimes it's better to do a bit of both ends...use your judgement).
Again...if you're outer barrel is really cockeyed on your receiver adjusting your sights is just going to be a pain in the ass. Looking from the top, the outer barrel should be in line with the centerline of the receiver...and from the side it should run in line with the center of the barrel nut. A proper metal straight edge that's a couple of feet long works to see this...or a long piece of string if you can jig it up right. Or...depending on your "eye for things" you might be able to tell straight from crooked by just looking at it.
So...all of the above and probably a bunch of other things could be causing it to shoot low and to the left.
Best of luck, hope that helps,