If any of you have played games such as Call Of Duty or Battlefield Bad Company you will know that you can improve your accuracy by aiming “through your sights” (pictured).
How would I go about creating this?
If any of you have played games such as Call Of Duty or Battlefield Bad Company you will know that you can improve your accuracy by aiming “through your sights” (pictured).
How would I go about creating this?
A big gui texture and a camera.
Well thats one way but that looks too “snappy” if you know what I mean? The weapon in the picture (i think) is a game object, not a gui texture, although they did it pretty well with a GUI texture in America’s Army
Hmm… I think that simply by creating a secondary position for the gun, and making the sight part of the actual model, you could create the illusion of raising your gun to your eye to use the sight, and with some sort of shader, create the blurred out effect on the gun.
Sights with actual zoom and glass refracting lenses will be a little different, but basically you’ll animate the gun into sighting position, then switch to a gui sight, then switch zoom for the sight’s zoom. Or something like that. That’s how I’m going to do mine.
we’re using gui textures for the sniper rifles and real transformations for anything else (less combat knife )
Lol. Sounds good.
Like I said, Urban Terror has a pretty good system for this.
urban terror don’t do sights do they??
??? Of course they do sights, at least scope sights. Scope sights are a must, I dunno about other sights.
One feature that they have that is awesome is the variable spray pattern and their means of showing the spray pattern. You have to get it and play it to see, sadly, but it’s awesome realism.
I set this up in my game. I basically got rid of the near clipping plane of the camera, and positioned the model up. Then I tuned the aiming by placing an small object in the front and rear sight post and did a raycast that ran through them.
any idea how to code inaccuracy?
Hmm… Dunno about coding it, but I know about showing it visually.
Pretend that the below is a typical game sight. The more rounds per minute you shoot, the further apart some bit of the sight gets, showing the size of the gun’s spray pattern.
I’d show that vertically too, but it’s hard to do with text. The space between the dashes is the size of the spray pattern. It’s more realistic this way, because the more you shoot, the less accurate the gun itself becomes (due in part to the barrel heating up, I think). Some guns have a larger maximum spray pattern than others. Some reach that maximum after a couple rounds, while others require more like 25 rounds to reach that maximum (like the IMI NEGEV 5.56 mm belt fed machine gun I mentioned in another post/topic).
I hope this helps.
There are quite a few days to handle inaccuracy. Such as, don’t even bother to calculate hits for some of the shots. Another other way is to add a random factor to the direction of the raycast ray used to aim.
could you reference the API of raycast inaccuracy?
A quick and low overhead solution would be to animate the gun into position in Unity then take a screen grab of the gun against a blue or green background.
bring into photoshop makes the blue transparent, blur and save as a 32bit tiff, png etc with alpha.
slap on a polly and bring back into Unity to line up with the original just infront of the camera, parent to the gun and fade between the two when going into ironsights ingame.
You would loose things like dynamic lighting and perspective on the gun in ironsights but I think it could work.
I think alot of these games are probably using depth of field and/or rendering to different cameras for things that are blurry and things that are not, I think this might be poss in Unity but would come at a higher gpu price.
However there are people here who know a lot more than me, just an idea.
Cheer’s for the input, of course for web games I think that is a must to cut strain as much as possible, I’ll try using the full object without result to flat textures and if that looks like bs then I’ll go with your idea.