Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Search the Community

Showing results for tags 'shoot'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
    • unity3D | Example Projects
    • unity3D | Scripts
    • unity3D | Shaders
    • unity3D | Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
    • FPSKit Download
    • FPSKit Modifications/Tutorials
    • FPSKit WIP/Showcase
    • Discussions / Bug reports
    • Sell
    • Request
  • Photon's Tutorials
  • Busy People's Introductions
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Photon's Photon General
  • Photon's Showcase
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials


  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files


  • Community Calendar

Facebook URL

Twitter URL

IndieGoGo URL

Kickstarter URL


GreenLight URL



Found 10 results

  1. Regular Gun Script

    Hello! This is my first post ever! I just wanted to share a simple gun script that uses C#. Probably the best script for beginners! There are two scripts, one for the gun, and one for the enemies to shoot at! Hope u like it! 1st script: using UnityEngine; public class Gun : MonoBehaviour { public float damage = 25f; public float range = 100f; public Camera fpsCam; public ParticleSystem muzzleFlash; // Update is called once per frame void Update () { if (Input.GetButtonDown("Fire1")) { Shoot(); } } void Shoot () { muzzleFlash.Play(); RaycastHit hit; if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range)) { Debug.Log(hit.transform.name); Target target = hit.transform.GetComponent<Target>(); if (target != null) { target.TakeDamage(damage); } } } } 2nd Script (Target Script) using UnityEngine; public class Target : MonoBehaviour { public float health = 50f; //what makes the damage work public void TakeDamage (float amount) { health -= amount; if (health <= 0f) { Die(); } } void Die () { Destroy(gameObject); } } There u go! those are all of the scripts! (Credit to brackeys for them.)
  2. Grunt1914

    Introduction I've decided to finally create a forum post for my game Grunt1914. I've been holding off for months because I dont feel like the game is quite ready for social media yet but I think I need to start putting it out there. We have been working on this game for about a year and a half now. Grunt1914 is a World War 1 themed multiplayer game set in various stages across the war torn world. It is based on the conflicts between the Allies and the Central Powers. You play as a foot-soldier fighting on a variety of maps from around the world at the time. You can play as an American, British, German or Ottoman soldier. You may use any weapon as any soldier meaning the weapons are not locked to their own countries's soldiers. Weapons are customizable in that you may add attachments to them in the load-out. Gameplay and content wise the experience will be somewhere between hardcore and casual. The game will be rather realistic but it wont be a "simulator". The game will have alternating weather and time of day for each round, which the match host can select. If you want to play in the snow at night time, that's up to you. If you want to play in the rain at daytime, you can. These factors will have an impact on game-play. Right now the game is using @themars2011's FPS MP kit for functionality but this is being heavily modified by one of our programmers. Content in the game Maps(Finished) Convoy The map is themed as a fueling and repairing location for war trains and vehicles in an undisclosed location in the North of America. The map features lots of cover in that it is littered with inactive or broken vehicles and trains. The map contains many vantage points and naturally thick vegetated areas. The map will feature sunny, snowy and rainy conditions for both daytime and night time. District The map is themed as a small untouched village in an undisclosed location in the West of Germany. The map features lots of cover in that it features many enter-able buildings, walls, and structures. The map has an outlay designed for close quarters combat but also features rooftops for longer ranged weaponry. The map will feature sunny, rainy and snowy conditions for both daytime and night time. Turmoil The map is themed as a war-torn homestead in an undisclosed location in the East of Germany. The map features lots of cover in the shape of terrain deformation due to bombings, encampments, hilltop bunkers, bombed houses and naturally thick vegetated areas. The map will feature sunny, snowy and rainy conditions for both daytime and night time. Solitude The map is themed as a royal cemetery in an undisclosed location in the North of Egypt. The map is very tight in terms of space and will require quick thinking to excel in. The map features lots of cover in the shape of graves, tombs, and tight angles. The map has many hidden spots so keep an eye on those pesky campers! The map will feature only clear conditions for both daytime and night time. Dugout The map is themed as a war-torn battlefield with debris scattered about in an undisclosed location in North-Eastern France. The map features countless war-torn burnt trees, logs and bushes that make for good cover. There are also underground dugouts containing ammunition and supplies for the battles that are held there. Among these there are also makeshift buildings such as bunkers. The map will feature sunny, rainy and snowy conditions for both daytime and night time. Maps(Unfinished) Passage Weapons The weapon list is a work in progress and will continually be updated. Rifles - Lee Enfield Mk I - Mauser K98 - Mauser M1916 - Lebel Model 1886 Semi-Automatics - MP40 - Sten MK5 - Thompson M1928A1 Automatics - M1918 Browning - MG 15 Shotguns - Remington M10 Pistols - Colt 1917 - Luger P08 Concept Art Here is some of the concept art that has been completed for Grunt1914. Maps Turmoil Convoy District Dugout Characters German infantry The game is continually being worked on and I will keep updating as progress is made. Follow the game Facebook Page Twitter and a website for the game will be online soon. There will also be a fundraiser at a later stage.
  3. Need A JS Gun Script

    I Need A Gun Script That I Can Modify For A Pistol, Assault Rifle, Sniper Rifle, Lmg, Smg, Etc; PM Me Here Or Respond To The Topic, Thanks.
  4. 3rd person FPS kit

    Here is a kit that i found, it looks like really intesting https://www.youtube.com/watch?v=tkQO0XawW2g
  5. Hi there! I am making a little fun game and i made a simple shoot and reload script for the game, so i wanted to share the script INSTRUCTIONS: 1). Create a C# script and call it PlayerShoot. 2). Remove everything in the script, and copy one of the scripts below(There's a Rigidbody and Raycast version) and paste it in the C# script you made. 3). Attach the script to the player. Rigidbody Version: Raycast Version: I have tested it, and it works fine You can attach the PlayerShoot script to the player. Remember the projectile has to have a rigidbody component or else it will throw a error(This is only if you use the Rigidbody version). If you have questions then ask EDIT1: I made some improvements. Added support for shoot and reload animation. Added a GUI label to show the ammo on the top left corner. Now you can't shoot while reloading. I think there's more but i can't remember. And you don't have to use animations, it's okay if you just leave it empty, btw the GameObject variable named "weapon" is only for the animations. So if you want to use animations you have to attach the GameObject that has the shoot and reload animation to the weapon variable ^^ Hope you enjoy, and you can always come with suggestions, like on what i could add more. EDIT2: Added a raycast version now Rigidbody Version Damage: 1). Make a seperate script and attach it to the projectile. 2). Open the script and do a OnCollisionEnter and check if the collision is the enemy or something and if it is then substract they health or anything else. Raycast Version Damage: 1). Find the DoDamage method(function) in script. 2). Replace what's in the DoDamage to what you like.
  6. if else problem?

    var ammo : int; var player : GameObject; enum status { idle,running,shooting,aiming,reloading,walking } var FireRate : float = 1; var NextFire : float = 1; var state = status.idle; function Update () { if(curammo > 0){ if (Input.GetMouseButton(0) && Time.time > NextFire) { state = state.shooting; NextFire = Time.time + FireRate; } else state = state.idle; } if(state == state.idle){ animation.Play("Idle"); } if(state == state.shooting){ animation.Play("Single_Shot"); } } so when i use this code, the state "shoot" never occurs... if i remove the "else state = state.idle;" .. the shoot state keeps on looping.. how could i stop the shooting state from looping?
  7. Societatem: FPS Multiplayer Game

    Hey there! I have started a new Indie FPS Multiplayer game called Societatem. Updates can be found on my channel at: https://www.youtube.com/user/RedCrusaderGames All game devs who want to join are welcome xD - RedCrusaderGames
  8. Shoot Script

    ENG This is a simple shoot script Animations required: fire reload RUS Простой скрипт стрельбы Требуются анимации: fire reload var Model : Animation; //модель с анимациями var range = 100.0; var fireRate = 0.05; //задержка между вылетом пуль var force = 100.0; // ускорение пули var damage = 5.0; // урон он нее var bulletsPerClip = 17; //пулей в магазине var clips = 2; // Магазинов var reloadTime = 0.7; // время перезарядки var accuracy = 1; // разброс var currentMode = fireMode.semi; //режим стрельбы (Одиночный/авто) var ShootKey : KeyCode; // кнопка стрельбы var ReloadKey : KeyCode; // кнопка перезарядки var soundFire : AudioClip; var soundReload : AudioClip; var soundEmpty : AudioClip; var bulletHolePrefab : GameObject; var bulletHolePrefabWall : GameObject; var bulletHolePrefabBlood : GameObject; var bulletHoleMetal : GameObject; var layerMask : LayerMask; var muzzleFlash : Renderer; enum fireMode { none, semi, auto} private var bulletsLeft : int = 0; private var allBullets; private var nextFireTime = 0.0; private var mainCamera; private var sound : AudioSource; private var reload : boolean; //var Crosshair : CrossHair; var guiStyle : GUISkin; var hud : Texture; var gunName : String; function Start () { bulletsLeft = bulletsPerClip; allBullets = clips*bulletsPerClip; mainCamera = GameObject.FindWithTag("Main Camera"); sound = gameObject.transform.parent.audio; muzzleFlash.enabled = false; } function Update() { //если не идет перезарядка, то можно стрелять и перезаряжать, иначе нельзя стрелять и перезаряжать пока перезарядка не пройдет. if (reload==false) { if (Input.GetKeyDown(ReloadKey)){ Reload(); } if (Input.GetKeyDown(ShootKey)){ if (bulletsLeft >0) { if (currentMode == fireMode.semi) { Fire(); } } else { sound.PlayOneShot(soundEmpty); } } if (Input.GetKey(ShootKey)){ if (currentMode == fireMode.auto) { Fire(); } } } } function Fire () { if (Time.time - fireRate > nextFireTime) nextFireTime = Time.time - Time.deltaTime; // Keep firing until we used up the fire time while( nextFireTime < Time.time && bulletsLeft != 0) { FireOneShot(); nextFireTime += fireRate; } } function FireOneShot () { //var direction = transform.TransformDirection(Vector3.forward); var direction = transform.TransformDirection(Vector3(Random.Range(-0.01, 0.01) * accuracy, Random.Range(-0.01, 0.01) * accuracy,1)); var hit : RaycastHit; Debug.DrawLine(mainCamera.transform.position,direction*range,Color.red); //для отладки // Проверяем попала ли куда-нибудь пуля if (Physics.Raycast (mainCamera.transform.position, direction, hit, range,layerMask.value)) { var rotation = Quaternion.FromToRotation(Vector3.up, hit.normal); // если пуля попадает в физический объект то двигаем его if (hit.rigidbody) hit.rigidbody.AddForceAtPosition(force * direction, hit.point); // если пуля попала в объект "Untagged" то сделать на нем дырку и приклеить ее к объекту if (hit.transform.tag == "Untagged") { var bulletHole : GameObject = Instantiate (bulletHolePrefab, hit.point, rotation); bulletHole.transform.parent = hit.transform; hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); } if (hit.transform.tag == "Concrete") { var bulletHoleWall : GameObject = Instantiate (bulletHolePrefabWall, hit.point, rotation); bulletHoleWall.transform.parent = hit.transform; hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); } if (hit.transform.tag == "Enemy") { var bulletHoleBlood : GameObject = Instantiate (bulletHolePrefabBlood, hit.point, rotation); bulletHoleBlood.transform.parent = hit.transform; hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); } if (hit.transform.tag == "Metal") { var bulletHoleMetal : GameObject = Instantiate (bulletHoleMetal, hit.point, rotation); bulletHoleMetal.transform.parent = hit.transform; hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); } } sound.PlayOneShot(soundFire); Model.animation.Rewind("fire"); Model.animation.CrossFade("fire"); bulletsLeft--; StartCoroutine(ShowMuzzleFlash()); } // перезарядка function Reload () { if (allBullets >0 && bulletsLeft != bulletsPerClip) { if (allBullets > bulletsPerClip) { //Crosshair.EnableCrosshair = false; reload = true; sound.PlayOneShot(soundReload); Model.animation.CrossFade("reload"); yield WaitForSeconds(reloadTime); allBullets-= bulletsPerClip-bulletsLeft; bulletsLeft =bulletsPerClip; reload = false; //Crosshair.EnableCrosshair = true; } else { reload = true; sound.PlayOneShot(soundReload); yield WaitForSeconds(reloadTime); var bullet = Mathf.Clamp(bulletsPerClip,allBullets,bulletsLeft+allBullets); allBullets -= (bullet-bulletsLeft); bulletsLeft = bullet; reload = false; } } } // показать вспышку от выстрела function ShowMuzzleFlash () { muzzleFlash.transform.localRotation *= Quaternion.Euler(0, 0, Random.Range(-360, 360)); //muzzleFlash.transform.localRotation = Quaternion.AngleAxis(Random.value * 360, Vector3.forward); muzzleFlash.enabled = true; yield WaitForSeconds(0.05f); muzzleFlash.enabled = false; } function OnGUI() { GUI.skin = guiStyle; GUI.Label(new Rect(Screen.width - 120,Screen.height - 80,200,50)," " + gunName + " : " + bulletsLeft + " / " + allBullets); } MY FIRST POST
  9. Hello, I'm trying to make zombie infection game, and i don't know how to make that when zombie knifes the player he will turn into a zombie too. Thanks (Sorry for my bad English)