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


Forums

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

Categories

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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 10 results

  1. Johannes

    Grunt1914

    Grunt1914 is a World War 1 themed multiplayer shooter set in various stages across the war torn world. It is based on the conflicts between the Allies and the Central Powers. Game-play and content wise the experience is somewhere between hardcore and casual. The game-play is fast and flowing. The game has options for alternating weather for each round, which the match host can select. You can choose between snow, rain or clear conditions for each outdoor map. There are 8 maps each in a different region around the world. There are three game modes - Deathmatch, Team Deathmatch, Gungame. With more to come. The game features a massive arsenal of true to life guns and weapons to slay your foes with! The game also features bots to play against. You can upgrade your level and unlock more guns. Most importantly, its really fun! Follow this page for all the news regarding this title. Social : Discord : https://discord.gg/Tc5b7D9 Facebook : https://www.facebook.com/Grunt1914/ Twitter : https://twitter.com/grunt1914 IndieDB : https://www.indiedb.com/games/grunt1914 Website : https://aligned-games.myfreesites.net/ Concept Art : Screenshots :
  2. 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.)
  3. 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.
  4. 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.
  5. Here is a kit that i found, it looks like really intesting https://www.youtube.com/watch?v=tkQO0XawW2g
  6. 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
  7. jag9980

    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?
  8. 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
  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)
×
×
  • Create New...