Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Sep 29, 2013 at 02:52 PM by robertbu for the following reason:

Copyrighted work/write code for you

avatar image
0
Question by CYVISUALEFFECTS · Sep 29, 2013 at 09:19 AM · cameralighting

Help with MuzzleFlash Script

So I have this script from UltimateFPS Camera package for the Muzzleflash. Is there any way to add to the script a few lines to make the muzzleflash actualy bright the area around up (with a light of course) when I shoot? Here's the script: ///////////////////////////////////////////////////////////////////////////////// // // vp_MuzzleFlash.cs // © VisionPunk. All Rights Reserved. // https://twitter.com/VisionPunk // http://www.visionpunk.com // // description: renders an additive, randomly rotated, fading out muzzleflash // /////////////////////////////////////////////////////////////////////////////////

 using UnityEngine;
 
 public class vp_MuzzleFlash : MonoBehaviour
 {
 
     protected float m_FadeSpeed = 0.075f;                // amount of alpha to be deducted each frame
     protected bool m_ForceShow = false;                    // used to set the muzzleflash 'always on' in the editor
     protected Color m_Color = new Color(1, 1, 1, 0.0f);
 
     protected Transform m_Transform = null;
 
     public float FadeSpeed { get { return m_FadeSpeed; } set { m_FadeSpeed = value; } }
     public bool ForceShow { get { return m_ForceShow; } set { m_ForceShow = value; } }
 
 
     /// <summary>
     /// 
     /// </summary>
     void Awake()
     {
 
         m_Transform = transform;
 
         // the muzzleflash is meant to use the 'Particles/Additive'
         // (unity default) shader which has the 'TintColor' property
         m_Color = renderer.material.GetColor("_TintColor");
         m_Color.a = 0.0f;
 
         m_ForceShow = false;
 
     }
 
 
     /// <summary>
     /// 
     /// </summary>
     void Start()
     {
         // if parent is a local player, don't clip muzzleflash against world geometry
         if (m_Transform.root.gameObject.layer == vp_Layer.LocalPlayer)
             gameObject.layer = vp_Layer.Weapon;
     }
 
 
     /// <summary>
     /// 
     /// </summary>
     void Update()
     {
 
         // editor force show
         if (m_ForceShow)
             Show();
         else
         {
             // always fade out muzzleflash if it is visible
             if (m_Color.a > 0.0f)
                 m_Color.a -= m_FadeSpeed * (Time.deltaTime * 60.0f);
         }
         renderer.material.SetColor("_TintColor", m_Color);
 
     }
 
 
     /// <summary>
     /// makes the muzzleflash show for editing purposes
     /// </summary>
     public void Show()
     {
         m_Color.a = 0.5f;    // the default alpha value for the 'Particles/Additive' shader is 0.5
     }
 
 
     /// <summary>
     /// shows and rotates the muzzleflash for when firing a shot
     /// </summary>
     public void Shoot()
     {
         m_Transform.Rotate(0, 0, Random.Range(0, 360));    // rotate randomly 360 degrees around z
         m_Color.a = 0.5f;    // the default alpha value for the 'Particles/Additive' shader is 0.5
     }
 
     
 }
 
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Sep 29, 2013 at 02:54 PM 0
Share

This appears to be someone purchased and copyrighted work (not your own work). Plus you are essentially asking someone to write a solution for you. I'm not comfortable with either. $$anonymous$$aybe you should look to the original author for support.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Image Effect lighting 0 Answers

Light Settings - Fog to a non-main camera? 0 Answers

Camera appearance black & white 1 Answer

Projected Movie Texture (How To) 0 Answers

Lighting Disabled. Black screen in Game view not in Camera preview 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges