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 /
avatar image
0
Question by bayerly · Apr 15, 2012 at 03:27 AM · image effectsparametersblurmodify

Need to Access GlowEffect From Script and Add To "Intensity" Parameter

Hey everyone, thanks in advance.

so I've got a simple .js attached to my FPS player that determines when a tagged object collides, and adds to a score. I also have audio that plays, triggered by the same collision.

I now want to increase the Blur Intensity on my Main Camera by 5, when I collide with the tagged object, and have the effect's increase disappear after a few seconds. Going further, I would eventually like to have this tweened so it's not as abrupt a transition.

Below is my script:


 var score = 0;
 var scoreText = "Score: 0";
 var MyFont : Font;
 
 
 function OnTriggerEnter( other : Collider ) {
     Debug.Log("OnTriggerEnter() was called");
     if (other.tag == "Coin") {
         Debug.Log("Other object is a coin");
         score += 5;
         scoreText = "Score: " + score;
         Debug.Log("Score is now " + score);
         yield WaitForSeconds (.2);
         Destroy(other.gameObject);
     }
 }



I have tried a few different ideas, but this is my base script. Let me know if you can help, thanks!

Pat

Comment
Add comment · Show 2
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 IgnoranceIsBliss · Apr 15, 2012 at 10:37 PM 0
Share

To be honest, to do what you're suggesting I'd actually create an animation and add it to the camera. You are able to animate the properties of virtually any behaviour attached to your object.

Then, when you want the blur to happen, in the script you simply play the animation.

All done - using the existing animation system you could then blend animations or layer then on top of each-other, resulting in smooth transitions.

avatar image bayerly · Apr 15, 2012 at 11:25 PM 0
Share

About 20 $$anonymous$$utes after I posted this, the same thought occurred to me. Thanks a bunch for the confirmation of my theory!

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Blur Effect 0 Answers

how enable / disable blur effect using script attached to another game object 1 Answer

Blur Image Effect doesn't work on iOS (Unity 5) 3 Answers

How to blur objects based on distance from the camera using Unity's optimized blur effect? 0 Answers

camera blur 1 Answer


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