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



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
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • 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 6 results

  1. Hi I'm trying to create a particle system that will appear on my bullet hole decal, Please explain how i would create this effect for different surfaces or just one generic one i could play with. Here is gun code: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class GunScript : MonoBehaviour { public Camera weaponCamera; public LayerMask thingsPlayerCanHit; public enum fireMode { Auto, Semi} public fireMode weaponType = fireMode.Auto; [Space] public float range; public float fireRate; public int minDamage; public int maxDamage; [Space] public Vector3 defaultPosition; public Vector3 aimedPostion; public float aimSpeed; public float aimFOV; [Space] public int clipSize; public int allAmmo; [Space] public Animation weaponAnimations; public AnimationClip fireAnim; public AnimationClip reloadAnim; [Space] public AudioSource weaponAudio; public AudioClip fireEffect; public AudioClip reloadEffect; public GameObject bulletHole; [Space] public GameObject muzzle; bool muzzleFlash = false; public Vector3 aimRotation; bool canFire; bool isReloading; [HideInInspector] public bool isSilencered; int currentAmmo; private void Start() { canFire = true; currentAmmo = clipSize; } private void Update() { CheckAimDownSights(); if (canFire) { if (currentAmmo <= 0) { Reload(); return; } if (weaponType == fireMode.Auto) { if (Input.GetButton("Fire1")) { StartCoroutine("Fire"); canFire = false; } } else if (weaponType == fireMode.Semi) { if (Input.GetButtonDown("Fire1")) { StartCoroutine("Fire"); canFire = false; } } } if (Input.GetKeyDown(KeyCode.R)) { Reload(); } } IEnumerator Fire() { currentAmmo--; weaponAnimations.Stop(); weaponAnimations.Play(fireAnim.name); weaponAudio.PlayOneShot(fireEffect); if (!isSilencered) StartCoroutine("FireEffects"); Ray ray = weaponCamera.ScreenPointToRay(new Vector2(Screen.width / 2, Screen.height / 2)); RaycastHit hitInfo; //Bullet Marks if (Physics.Raycast(ray, out hitInfo, weaponCamera.farClipPlane)) { Vector3 bulletHolePosition = hitInfo.point; // We need a variable to hold the rotation of the prefab // The new rotation will be a match between the quad vector forward axis and the hit normal Quaternion bulletHoleRotation = Quaternion.FromToRotation(-Vector3.forward, hitInfo.normal); GameObject hole = (GameObject)GameObject.Instantiate(bulletHole, bulletHolePosition, bulletHoleRotation); } yield return new WaitForSeconds(fireRate); Destroy(bulletHole); canFire = true; } IEnumerator FireEffects () { if (muzzleFlash) // Has muzzle flash? { muzzle.SetActive(true); // Active the muzzle flash. muzzle.transform.localRotation = Quaternion.Euler(new Vector3(0, 0, Random.Range(0, 360))); // Sets a random rotation. yield return new WaitForSeconds(0.03f); // Awaits the 3 millisecond interval. muzzle.SetActive(false); // Disable the muzzle flash. } } float GetWeaponDamage(float distance) { float damageToDeal = (maxDamage - minDamage) * (1 - (distance / range)); return damageToDeal; } void Reload() { if (currentAmmo == clipSize || allAmmo == 0) return; weaponAudio.PlayOneShot(reloadEffect); if(allAmmo >= (clipSize - currentAmmo)) { allAmmo -= (clipSize - currentAmmo); currentAmmo += (clipSize - currentAmmo); } else { currentAmmo += allAmmo; allAmmo = 0; } isReloading = true; canFire = false; weaponAnimations.CrossFade(reloadAnim.name); StartCoroutine("ReturnFromReloading"); } IEnumerator ReturnFromReloading() { yield return new WaitForSeconds(reloadAnim.length); canFire = true; isReloading = false; } void CheckAimDownSights() { if (Input.GetButton("Fire2") && !isReloading) { transform.localRotation = Quaternion.Lerp (transform.localRotation, Quaternion.Euler (aimRotation), Time.deltaTime * aimSpeed); transform.localPosition = Vector3.Lerp (transform.localPosition, aimedPostion, Time.deltaTime * aimSpeed); } else { transform.localPosition = Vector3.Lerp(transform.localPosition, defaultPosition, Time.deltaTime * aimSpeed); transform.localPosition = Vector3.Lerp (transform.localPosition, defaultPosition, Time.deltaTime * aimSpeed); } } void OnGUI (){ // GUI.Box (new Rect (10, 10, 100, 50 ("Ammo is"))); GUI.Label(new Rect(10, 10, 100, 50), currentAmmo.ToString() + " / " + allAmmo.ToString()); } } I have already created prefab of metal with shader Particle/additive. Any help is appreciated here.
  2. Hi, I'm using the C# version of FPS Kit 2 v1.5. I add a weapon and an optic (Holographic Sight), so when I fire the weapon in hip mode, the bullet goes to the center of the screen. Nice. When I'm aiming: When I aiming, the bullet goes lower than my Red Reticle of the HoloSight, making you hit the chest when pointing to the target's head. Is there some way to change that? Or I'm doing something wrong? I copied the script parameters from the defalut M4 w/ Silencer. I think that this part of code is responsable to set from where the bullet spawn and hit. Vector3 dir = gameObject.transform.TransformDirection(new Vector3(Random.Range(-0.01f, 0.01f) * triggerTime, Random.Range(-0.01f, 0.01f) * triggerTime, 1)); Vector3 pos = transform.parent.position; //Vector3 pos = OpticPos.transform.position; if (Physics.Raycast(pos, dir, out hit, range, layerMask))
  3. Hello, I am interested in the question as you can well realize the effect of bullets flying in FPS Kit 2 1.2. I did spawn a bullet with a predetermined force, but the problem is that in the past that you need to consider the inaccuracy of the shooting created a raycast! I turned to shoot, a hole appears from the raycast in one place, and the bullet flew in another place. I want a bullet follows the trajectory raycast with his inaccuracy! Thanks in advance! Here is the code what //My variables var bulletspawn : Transform; var BulletParticle : Rigidbody; var powerbullet : int = 100; //My variables function fireOneBullet (){ var clone : Rigidbody;//My variables var bulletP : Rigidbody;//My variables //What is written to spawn if(draw==false){ if(BulletParticle){ bulletP = Instantiate(BulletParticle, bulletspawn.position, bulletspawn.rotation); bulletP.velocity = bulletspawn.TransformDirection(Vector3.forward * powerbullet); } } //What is written to spawn if (nextFireTime > Time.time || draw){ if(bulletsLeft <= 0){ OutOfAmmo(); } return; } var direction = gameObject.transform.TransformDirection(Vector3(Random.Range(-0.01, 0.01) * triggerTime, Random.Range(-0.01, 0.01) * triggerTime,1)); var hit : RaycastHit; var position = transform.parent.position; if (Physics.Raycast(position, direction, hit, range, layerMask.value)) { var contact = hit.point; var rotation = Quaternion.FromToRotation(Vector3.up, hit.normal); if (hit.rigidbody){ hit.rigidbody.AddForceAtPosition(force * direction, hit.point); } if (hit.transform.tag == "Water") { var waterHole = Instantiate (Water, contact, rotation) as GameObject; hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); waterHole.transform.parent = hit.transform; waterHole.transform.Rotate(new Vector3(0, Random.Range(-180.0, 180.0), 0));// } if (hit.transform.tag == "Glass") { var glassHole = Instantiate (Glass, contact, rotation) as GameObject; hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); glassHole.transform.parent = hit.transform; } if (hit.transform.tag == "Untagged") { var default1 = Instantiate (untagged, contact, rotation) as GameObject; hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); default1.transform.parent = hit.transform; } if (hit.transform.tag == "Concrete") { var bulletHole = Instantiate (Concrete, contact, rotation) as GameObject; hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); bulletHole.transform.parent = hit.transform; } if (hit.transform.tag == "Wood") { var woodHole = Instantiate (Wood, contact, rotation) as GameObject; hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); woodHole.transform.parent = hit.transform; } if (hit.transform.tag == "Metal") { var metalHole = Instantiate (Metal, contact, rotation) as GameObject; hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); metalHole.transform.parent = hit.transform; } if (hit.transform.tag == "Dirt") { var dirtHole = Instantiate (Dirt, contact, rotation) as GameObject; hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); dirtHole.transform.parent = hit.transform; } if (hit.transform.tag == "canBeUsed") { hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); } if (hit.transform.tag == "Enemy") { hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); yield WaitForSeconds(0.01); var bloodHole = Instantiate (Blood, contact, rotation) as GameObject; if(Physics.Raycast (position, direction, hit, range, layerMask.value)){ if(hit.rigidbody){ hit.rigidbody.AddForceAtPosition(force * direction, hit.point); } } }else if (hit.transform.tag == "EnemyA") { hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); yield WaitForSeconds(0.01); var bloodHole2 = Instantiate (Blood, contact, rotation) as GameObject; if(Physics.Raycast (position, direction, hit, range, layerMask.value)){ if(hit.rigidbody){ hit.rigidbody.AddForceAtPosition(force * direction, hit.point); } } }else if (hit.transform.tag == "EnemyI") { hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); yield WaitForSeconds(0.01); var bloodHole3 = Instantiate (Blood, contact, rotation) as GameObject; if(Physics.Raycast (position, direction, hit, range, layerMask.value)){ if(hit.rigidbody){ hit.rigidbody.AddForceAtPosition(force * direction, hit.point); } } }else if (hit.transform.tag == "EnemyAS") { hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); yield WaitForSeconds(0.01); var bloodHole4 = Instantiate (Blood, contact, rotation) as GameObject; if(Physics.Raycast (position, direction, hit, range, layerMask.value)){ if(hit.rigidbody){ hit.rigidbody.AddForceAtPosition(force * direction, hit.point); } } }else if (hit.transform.tag == "EnemyIS") { hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver); yield WaitForSeconds(0.01); var bloodHole5 = Instantiate (Blood, contact, rotation) as GameObject; if(Physics.Raycast (position, direction, hit, range, layerMask.value)){ if(hit.rigidbody){ hit.rigidbody.AddForceAtPosition(force * direction, hit.point); } } } } PlayAudioClip(soundFire, transform.position, 0.7); if(use_silenced==false){ ShumActive(); } m_LastFrameShot = Time.frameCount; weaponAnim.animation.Rewind("Fire"); weaponAnim.animation.Play("Fire"); KickBack(); bulletsLeft--; } I did.
  4. Hey guys, I'm new here after seeing a link posted on reddit Anyway, I thought I would post up a few of my assets that I sell in the Unity Asset store to get some visibility here. Hopefully you guys might find them useful. You can grab a copy off the Unity Asset store or from my website via paypal: Asset contents ============== 1. Bullet pattern and weapon preset/selection script 2. Bullet/Object Pooling manager script 3. Bullet script + base bullet prefabs 4. Player movement/control script 5. Background, bullet, and player sprites (space ship sprite and a zombie character sprite with walk animation) 6. 2 x demo scenes with fully customisable controls/examples Web player demo - two demo scenes to try out More screenshots: PROMO CODE Here's a promo code for Armed Unity members - you can use to get 30% off the asset (or any others I sell) if you buy from my website (the second link up above): ARMEDUNITY Enjoy, and if you have any questions feel free to post em up here
  5. Hey, i have made this great working bullet hole script kinda like in Valve Games for example CSGO. Heres what i mean, watch my update video (link below) and you will see me showing what special it does, and BTW, it does force to rigidbodys, supports Reloading Animations and much more. Update Video: http://www.youtube.com/watch?v=t49IwuJxvdc&list=UUEom3TPdX7_5zE51Ur5Z8_A&feature=c4-overview I whant to Sell this system becouse it was freaking hard to make and its using shadders. I think it should have been 10 eurs or so but i will sell it for 2 Eurs. How do we make deal, you add me on skype (ghalexander91), in 24 hours or mutch mutch less i accept your request. Then i give you link in where you shall Donate me 2 EURS. After i get email that you have donated me i instantly send you rar file where the Bullet Hole system scripts are, and explane you how to use it. FOR PROOF THAT IM THE CREATOR OF THIS SCRIPT AND THERES NO JOKE IM GOING TO SEND YOU RANDOM JUST MADE SCREENSHOTS ON HOW THEY LOOK INSIDE. Please, just please, after successful purchase and other, find a minute to say that everything is ok or something else.
  6. The Undead (Open World FPS): [unity3D] INFO COMING SOON BECAUSE WE UPDATED STORYLINE Team: Screenshots: Videos: Rules: .No commenting random things that are in-relevent to Bullet Speed! .Please don't just hate! give feedback and tell us what to do but try respect the chat below! Why do i say this? Most of my post have these issues and i just think making rules for my thread might help Comment Below if you want to join or feedback would be nice (Good And Bad) SKYPE: samuel21103
×
×
  • Create New...