|
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).
(comments are locked)
|
|
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. eg:
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... Edited title like you said and yes yusing thumb stick and such.
Jul 01 '10 at 01:28 PM
MikezNesh
How do you make the crosshair circle follow your movement?
Jul 01 '10 at 01:30 PM
MikezNesh
How can I add it so the cross hair moves if I move my thumb stick? And how do I make the gun shoot aim at the cross hair circle?
Jul 01 '10 at 01:31 PM
MikezNesh
How should I do the raycast to shoot?
Jul 01 '10 at 01:43 PM
MikezNesh
Normally in an FPS the look control moves the camera, and the crosshair is fixed to the center of that. Unless we're talking more like an on-the-rails shooter, eg. Time Crisis?
Jul 01 '10 at 04:35 PM
Novodantis 1
(comments are locked)
|
