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 'fire'.



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. Hi there, this is a fire light behaviour script I just made and I just wanted to share it It is not advanced, it is just lerping the position and the light's intensity to somewhat simulate a fire's light. Anyways, just attach the script to the fire's light, tweak the values and you're good to go Copy the below, then create a new C# script, and then paste the code in it(or write it all if ya want ). /* * Author: DeepWolf * Description: Simulates a light's behaviour of a fire. * * Usage: * Attach this script to the light source of the fire and tweak the values. */ namespace DeepWolf.Utilities { using UnityEngine; /// <summary> /// Represents a <see cref="FireLight"/>. /// Handles the breathing and the movement of the fire. /// </summary> [RequireComponent(typeof(Light))] public class FireLight : MonoBehaviour { /// <summary> /// How frequently the <see cref="FireLight"/> will find a new position. /// </summary> [Header("[Movement]")] [SerializeField, Tooltip("How frequenly the light will find a new position.")] private float moveFrequency = 0.15f; /// <summary> /// The lerp speed of the fire movement. The lower the speed, the smoother the movement will be. /// </summary> [SerializeField, Tooltip("The lerp speed of the fire movement. The lower the speed, the smoother the movement will be.")] private float moveLerpSpeed = 1.0f; /// <summary> /// The min and max value of how much the <see cref="FireLight"/>'s <see cref="Transform"/> is able to move in the x axis. /// </summary> [SerializeField, Tooltip("The min and max value of how much the light is able to move in the x axis.")] private Vector2 xMoveLimit = new Vector2(-0.2f, 0.2f); /// <summary> /// The min and max value of how much the <see cref="FireLight"/>'s <see cref="Transform"/> is able to move in the y axis. /// </summary> [SerializeField, Tooltip("The min and max value of how much the light is able to move in the y axis.")] private Vector2 yMoveLimit = new Vector2(-0.0f, 0.15f); /// <summary> /// The min and max value of how much the <see cref="Light"/>'s <see cref="Transform"/> is able to move in the z axis. /// </summary> [SerializeField, Tooltip("The min and max value of how much the light is able to move in the z axis.")] private Vector2 zMoveLimit = new Vector2(-0.2f, 0.2f); /// <summary> /// The breathing frequency of the <see cref="Light.intensity"/>. /// </summary> [Header("[Intensity Breathing]")] [SerializeField, Tooltip("The breathing frequency of the light's intensity.")] private float IntensityBreathFrequency = 0.5f; /// <summary> /// The speed of the intensity transition. /// </summary> [SerializeField, Tooltip("The speed of the intensity transition.")] private float intensityLerpSpeed = 2.0f; /// <summary> /// The minimum the <see cref="Light.intensity"/> value can be. /// </summary> [SerializeField, Tooltip("The minimum the light's intensity value can be.")] private float minIntensity = 0.5f; /// <summary> /// The maximum the <see cref="Light.intensity"/> value can be. /// </summary> [SerializeField, Tooltip("The maximum the light's intensity value can be.")] private float maxIntensity = 1.0f; /// <summary> /// The <see cref="Time.time"/> till the next move transition. /// </summary> private float nextMove; /// <summary> /// The <see cref="Time.time"/> till the next intensity transition. /// </summary> private float nextIntensity; /// <summary> /// The <see cref="Light.intensity"/> value to transition to. /// </summary> private float targetIntensity; /// <summary> /// The <see cref="Light.intensity"/> value to transition to. /// </summary> private Vector3 targetPosition; /// <summary> /// The original <see cref="FireLight"/> position. Used to offset the move limits from the orignal position when looking for a new position to transition to. /// </summary> private Vector3 originalPosition; /// <summary> /// The <see cref="Light"/> component on the <see cref="FireLight"/>. /// </summary> private new Light light; /// <summary> /// The <see cref="Transform"/> component on the <see cref="FireLight"/>. /// </summary> private new Transform transform; private void Awake() { light = GetComponent<Light>(); transform = GetComponent<Transform>(); originalPosition = transform.position; } private void Update() { HandleMovement(); HandleIntensityBreathing(); } /// <summary> /// Handles the movement transition to the <see cref="targetPosition"/>. /// </summary> private void HandleMovement() { // Move to target position transform.position = Vector3.Lerp(transform.position, targetPosition, moveLerpSpeed * Time.deltaTime); if (nextMove <= Time.time) { FindNewPosition(); nextMove = Time.time + moveFrequency; } } /// <summary> /// Finds a new <see cref="targetPosition"/> to transition to. /// </summary> private void FindNewPosition() { float newX = originalPosition.x + Random.Range(xMoveLimit.x, xMoveLimit.y); float newY = originalPosition.y + Random.Range(yMoveLimit.x, yMoveLimit.y); float newZ = originalPosition.z + Random.Range(zMoveLimit.x, zMoveLimit.y); // Find new position targetPosition.Set(newX, newY, newZ); } /// <summary> /// Handles the breathing of the <see cref="FireLight"/> by changing the <see cref="Light.intensity"/> smoothly to the <see cref="targetIntensity"/>. /// </summary> private void HandleIntensityBreathing() { light.intensity = Mathf.Lerp(light.intensity, targetIntensity, intensityLerpSpeed * Time.deltaTime); if (nextIntensity <= Time.time) { FindNewIntensity(); nextIntensity = Time.time + IntensityBreathFrequency; } } /// <summary> /// Finds a new <see cref="targetIntensity"/> to transition to. /// </summary> private void FindNewIntensity() { targetIntensity = Random.Range(minIntensity, maxIntensity); } } }
  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. I have here a script who contains the following configuranções, I have the animations "reload"/"Draw"/"Fire" animation "fire" works with the script and an "animation", the rate of fire works like this: If I have a short animation, the gun shoots faster, if I have an animation of "Fire" long, the gun shoots and after a great time shoots again, I wanted to know how I can modify the script so I have a animations that starts "over" the other for the "rate of fire" to be fast as well. using UnityEngine; using System.Collections; public class gunScript : MonoBehaviour { public int clipSize = 6; public Texture hitMarker; public Animation anim; public AnimationClip shoot; public AnimationClip reload; public AnimationClip draw; [HideInInspector] public int ammo = 0; [HideInInspector] public int oldAmmo = 0; float coolDown = 0; public int maxDamage = 50; public int lowDamage = 30; public bool singleShot = false; public float rateOfFire = 0.1f; public float range = 1500; public float recoilAmnt = 0.2f; public float recoilShake = 5f; public float recoilSpeed = 5f; public Transform forward; public float accuracy = 0.3f; public camRecoil recoilScript; public Transform[] pelletSpawns; public GameObject groundHit; public GameObject bloodHit; public Transform muzzle; public GameObject muzzleFlash; public AudioClip shootSFX; public AudioClip reloadSFX; public int magazines = 10; public PhotonView tpEff; float killCool = 0; float hitMarkerTime = 1; void Awake() { ammo = clipSize; setLayer(); if(drawTracer) { if (muzzle == null) { drawTracer = false; Debug.LogError("Muzzle Trasform Not Set, Draw Trace' Set To Fale"); } } } void Update() { if(killCool > 0) { killCool -= Time.deltaTime; } if (!singleShot) { if (Input.GetButton("Fire1")) { Fire(); } } else { if (Input.GetButtonDown("Fire1")) { FireSingle(); } } if (Input.GetKeyUp(KeyCode.R)) { rel(); } if(coolDown > 0) { coolDown += -Time.deltaTime; } } public bool drawTracer = true; public void Fire() { if (coolDown <= 0 && !anim.IsPlaying(reload.name) && !anim.IsPlaying(draw.name)) { if (ammo > 0) { anim.Play(shoot.name); ammo += -1; coolDown += rateOfFire; if(recoilScript != null) { recoilScript.StartRecoil(recoilAmnt, recoilShake, recoilSpeed); } tpEff.RPC("shootEff", PhotonTargets.All, shootSFX.name); if (muzzleFlash && muzzle != null) { GameObject mf = Instantiate(muzzleFlash, muzzle.position, muzzle.rotation) as GameObject; mf.transform.parent = transform; Destroy(mf, 1); } if (pelletSpawns.Length == 0) { RaycastHit hit; Vector3 fwd = new Vector3(forward.forward.x + Random.Range(-accuracy, accuracy) / 10, forward.forward.y + Random.Range(-accuracy, accuracy) / 10, forward.forward.z); if (Physics.Raycast(forward.position, fwd, out hit, range)) { //draw tracer if (drawTracer) { GameObject line = new GameObject(); line.transform.SetParent(GameObject.Find("_Room").transform); line.name = "tracer"; LineRenderer ln = line.AddComponent<LineRenderer>(); ln.SetWidth(0.01f, 0.005f); ln.material = new Material(Shader.Find("Diffuse")); ln.material.color = Color.yellow; ln.SetPosition(0, muzzle.position); ln.SetPosition(1, hit.point); Destroy(line, 0.05f); } if (hit.transform.tag == "Player") { //Debug.Log("hit!"); if (hit.transform.GetComponent<PhotonView>() != null) { tpEff.gameObject.SendMessage("hitCol", hit.collider); hit.transform.GetComponent<PhotonView>().RPC("ApplyDamage", PhotonTargets.AllBuffered, Random.Range(lowDamage, maxDamage), PhotonNetwork.playerName, hit.collider.name); killCool = hitMarkerTime; //Seconds to show hit marker } GameObject par = Instantiate(bloodHit, hit.point, Quaternion.identity) as GameObject; Destroy(par, 5f); } else { Quaternion hitRotation = Quaternion.FromToRotation(Vector3.up, hit.normal); GameObject par = Instantiate(groundHit, hit.point, hitRotation) as GameObject; Destroy(par, 5f); } } } else { foreach (Transform pelletSpawn in pelletSpawns) { RaycastHit hit; if (Physics.Raycast(pelletSpawn.position, pelletSpawn.forward, out hit, range)) { if (hit.transform.tag == "Player") { Debug.Log("hit!"); if (hit.transform.GetComponent<PhotonView>() != null) { hit.transform.GetComponent<PhotonView>().RPC("ApplyDamage", PhotonTargets.AllBuffered, Random.Range(lowDamage, maxDamage), PhotonNetwork.playerName, hit.collider.name); killCool = hitMarkerTime; //Hitmarker seconds } GameObject par = Instantiate(bloodHit, hit.point, Quaternion.identity) as GameObject; Destroy(par, 5f); } else { Quaternion hitRotation = Quaternion.FromToRotation(Vector3.up, hit.normal); GameObject par = Instantiate(groundHit, hit.point, hitRotation) as GameObject; Destroy(par, 5f); } } } } } else { rel(); } } } public void FireSingle() { if (!anim.IsPlaying(shoot.name) && !anim.IsPlaying(reload.name) && !anim.IsPlaying(draw.name)) { if (ammo > 0) { anim.Play(shoot.name); ammo += -1; coolDown += rateOfFire; tpEff.RPC("shootEff", PhotonTargets.All, shootSFX.name); if (recoilScript != null) { recoilScript.StartRecoil(recoilAmnt, recoilShake, recoilSpeed); } if (muzzleFlash && muzzle != null) { GameObject mf = Instantiate(muzzleFlash, muzzle.position, muzzle.rotation) as GameObject; mf.transform.parent = transform; Destroy(mf, 1); } if (pelletSpawns.Length == 0) { RaycastHit hit; Vector3 fwd = new Vector3(forward.forward.x + Random.Range(-accuracy, accuracy) / 10, forward.forward.y + Random.Range(-accuracy, accuracy) / 10, forward.forward.z); if (Physics.Raycast(forward.position, fwd, out hit, range)) { //draw tracer if (drawTracer) { GameObject line = new GameObject(); line.transform.SetParent(GameObject.Find("_Room").transform); line.name = "tracer"; LineRenderer ln = line.AddComponent<LineRenderer>(); ln.SetWidth(0.01f, 0.005f); ln.material = new Material(Shader.Find("Diffuse")); ln.material.color = Color.yellow; ln.SetPosition(0, muzzle.position); ln.SetPosition(1, hit.point); Destroy(line, 0.05f); } if (hit.transform.tag == "Player") { //Debug.Log("hit!"); if (hit.transform.GetComponent<PhotonView>() != null) { tpEff.gameObject.SendMessage("hitCol", hit.collider); hit.transform.GetComponent<PhotonView>().RPC("ApplyDamage", PhotonTargets.AllBuffered, Random.Range(lowDamage, maxDamage), PhotonNetwork.playerName, hit.collider.name); killCool = hitMarkerTime; //hit marker seconds } GameObject par = Instantiate(bloodHit, hit.point, Quaternion.identity) as GameObject; Destroy(par, 5f); } else { Quaternion hitRotation = Quaternion.FromToRotation(Vector3.up, hit.normal); GameObject par = Instantiate(groundHit, hit.point, hitRotation) as GameObject; Destroy(par, 5f); } } } else { foreach (Transform pelletSpawn in pelletSpawns) { RaycastHit hit; if (Physics.Raycast(pelletSpawn.position, pelletSpawn.forward, out hit, range)) { //draw tracer if (drawTracer) { GameObject line = new GameObject(); LineRenderer ln = line.AddComponent<LineRenderer>(); line.transform.SetParent(GameObject.Find("_Room").transform); line.name = "tracer"; ln.SetWidth(0.01f, 0.005f); ln.material = new Material(Shader.Find("Diffuse")); ln.material.color = Color.yellow; ln.SetPosition(0, muzzle.position); ln.SetPosition(1, hit.point); Destroy(line, 0.02f); } if (hit.transform.tag == "Player") { //Debug.Log("hit!"); if (hit.transform.GetComponent<PhotonView>() != null) { hit.transform.GetComponent<PhotonView>().RPC("ApplyDamage", PhotonTargets.AllBuffered, Random.Range(lowDamage, maxDamage), PhotonNetwork.playerName, hit.collider.name); killCool = hitMarkerTime; //hit marker seconds } GameObject par = Instantiate(bloodHit, hit.point, Quaternion.identity) as GameObject; Destroy(par, 5f); } else { Quaternion hitRotation = Quaternion.FromToRotation(Vector3.up, hit.normal); GameObject par = Instantiate(groundHit, hit.point, hitRotation) as GameObject; Destroy(par, 5f); } } } } } else { rel(); } } } public void rel() { if (ammo < clipSize && magazines > 0) { oldAmmo = ammo; anim.CrossFade(reload.name); ammo = clipSize; magazines += -1; tpEff.RPC("reload", PhotonTargets.AllBuffered, reloadSFX.name); } } void OnEnable() { anim.Play(draw.name); } void OnDisable() { if (anim.IsPlaying(reload.name)) { ammo = 0; magazines += 1; } } void OnGUI() { if (GameObject.Find("_Room") != null) { GUI.skin = GameObject.Find("_Room").GetComponent<roomManager>().skin; } GUIStyle ammoStyle = new GUIStyle(GUI.skin.box); ammoStyle.fontSize = 36; GUIStyle ammoStyle2 = new GUIStyle(GUI.skin.box); ammoStyle2.fontSize = 24; ammoStyle2.alignment = TextAnchor.MiddleLeft; GUI.Label(new Rect(10, Screen.height - 100, 100, 50), ammo + "/" + clipSize, ammoStyle); GUI.Box(new Rect(100, Screen.height - 100, 50, 50), "/" + magazines, ammoStyle2); //hitMarker if(hitMarker != null) { if (killCool > 0) { Color c = Color.white; c.a = killCool; GUI.color = c; float hMLength = hitMarker.width / 2; GUI.DrawTexture(new Rect(Screen.width / 2 - hMLength, Screen.height / 2 - hMLength, hMLength * 2, hMLength * 2),hitMarker, ScaleMode.StretchToFill); } } } public void setLayer() { foreach (MeshRenderer mr in gameObject.GetComponentsInChildren<MeshRenderer>()) { mr.gameObject.layer = 9; } foreach (SkinnedMeshRenderer mr in gameObject.GetComponentsInChildren<SkinnedMeshRenderer>()) { mr.gameObject.layer = 9; } } }
  4. Hi guys how is it going? I know this is a long stretch but I am in need of some decent gun and arms rigs that are animated with the following animations: > Idle > Reload > Fire > Draw If anyone has some animated guns with arms on their PC or wherever, and are willing to share with the community for place holders only, NON COMMERCIAL use....then please help me. All the best, HairySeal
  5. Hello, i am new here on AU and thought id share a tutoral i made a while back, how to make a campfire effect in Unity. The complete project is also included in the end of the tutorial. Link: https://www.davidstenfors.com/tutorials/unity-tutorials/campfire-tutorial Video of the finished effect: https://www.youtube.com/watch?v=KJ15DMxoDh4
  6. Gaze

    The Simple Fire Engine

    Hey guys! So a few months ago i made this simple fire engine thingy, witch basically allows you to make spreading fire. Then i decided to sell it since it was the only one of its kind out there. If you want you can check it out at the Asset Store page: https://www.assetstore.unity3d.com/en/#!/content/23064 It's two dollars, nothing much of an investment. Video demonstration: It was also used in my Skyrim in Unity Video:
  7. 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
  8. Johannes

    Survival Campfire

    Now moved to: http://armedunity.com/topic/9297-survival-assets-pack/#entry82153
  9. Hey, I'm using FPS Kit And I want to BLOCK the option of fire and shoot while i'm running, that looks wierd :\ How Can I Block It?
  10. Scripters And Modelers Needed For Alpha Fire.. If You Are Interested Contact Me Via Skype: (curtis.woodside)
×
×
  • Create New...