What would be the best way to set up shooting mechanics in a FPS? I know how to instantiate a bullet from a spawn point but...
How would you set up the little circle which signifies where you shoot at?
And how would you set the reloading mechanics?
(Please don't tell me to use the FPS game Unity provided because that doesn't work for Unity iPhone).
If this is for an iPhone then I recommend editing the question to include it in the title/tag, as it's pretty important.
I'm guessing you will use an on-screen thumb stick for movement and an on-screen button to shoot?
Firstly I would use raycasting for shots, unless you need to see the actual projectile, as physics is costly on the iPhone (I'm sure you know). The crosshair circle (where you aim) should be as simple as a GUI graphic in the center of the screen (unless we're firing something with gravity/bounce behaviour). Reloading can be simple as a value reset with sound effect, or can include an animation if the weapon is visible.
This is a very simple script, you can of course make many improvements (like a delay so reload is not instantaneous), but you get the idea from it...
answered Jul 01 '10 at 01:23 PM