|
Hey, I'm trying to make my FPS character shoot a bullet but it is not working, their are no errors or anything here is my moving and shooting script /
the "mouse" part is what I named the left click button.
(comments are locked)
|
|
Just use this:
You're instantiating a projectile at wherever 'spawnpoint' is, which, I'm assuming, is where you spawn? If that's the case, that's why your script isn't working. Ah thanks but the prob is as you see in my script I already have a speed var, and thats for my characters speed. How do I make two? One for running and one for shooting.
Apr 27 '10 at 03:19 AM
DTJ Productions
Oh and it is weird the bullets are not shooting in curtain areas, and also the more I move left the more the bullets spawn from the left.
Apr 27 '10 at 03:21 AM
DTJ Productions
Well, to make two speed vars, name your bullet speed bulSpeed or something of that sort. Unity figures out the physX for you, don't worry about adding the player's running speed to the bullet speed or anything like that.
Apr 27 '10 at 11:50 AM
e.bonneville
Also, put that script on a separate file and attach it either to your camera or a point you want your bullets to spawn from, like in front of your gun or wherever your gun should be.
Apr 27 '10 at 11:51 AM
e.bonneville
(comments are locked)
|
|
You can use Raycasts and a delay based on the ray distance to make bullets. It is more appropriate because bullets generally have a ridiculous speed and a small size and physics don't update in a perfect manner. they have "holes" in the path.
(comments are locked)
|
