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

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


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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL





YouTube URL

Facebook URL

Twitter URL

IndieGoGo URL

Kickstarter URL


GreenLight URL



Found 2 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. Hello guys and welcome to another tutorial! In this tutorial we are going to create a ground behaviour system! Somebody (I don't know who it was, I'm sorry) asked for it, so here it is! The system includes: *speed depending on the surface *footstep sounds depending on the surface *(you need to add your own variables to the script, because this is just the basic and for each game it is different ) I know it is a quick tutorial, but because I think it is boring to watch somebody programming I'm going to explain everything! If you want to use the script I'm using you can pause the video and take a little bit longer, or you can like my fb page and ask for the script I hope you guys like it! Also if you got any questions, just ask in the comments!
  • Create New...