Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 DavidKreft · Jun 29, 2018 at 07:17 PM · scripting problemcomponentsenable and disable script

I cannot get script component.

I want to enable/disable bloom effect through script. I have done it in my previous projects successfully. I've tried creating new projects, scripts. Nothing helped.

zrzut-ekranu-2168.png (288.2 kB)
zrzut-ekranu-2169.png (417.9 kB)
Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Vicarian · Jun 29, 2018 at 07:21 PM

Bloom's no longer a class as of Unity 5.4 or so. Use the Post-Processing Stack. Search for it on asset store.

Comment
Add comment · Show 2 · Share
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 DavidKreft · Jun 29, 2018 at 07:32 PM 0
Share

I’ve choosed older version because it is easier for me to manage graphics settings from game menu. I don’t know how to do it with the latest version.

avatar image Vicarian DavidKreft · Jun 29, 2018 at 07:36 PM 0
Share

I wouldn't advise this, but you can do what you want. You'll have to search your local documentation because Unity Technologies no longer has documentation online from any version prior to 5.1.

avatar image
0

Answer by HHammerite · Jun 29, 2018 at 07:23 PM

Where in your project is the 'Bloom' script located? You probably need to add a reference to it at the top of your file.

Comment
Add comment · Show 3 · Share
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 DavidKreft · Jun 29, 2018 at 07:36 PM 0
Share

As you can see on the image bloom script is added to main camera. In my old projects i didn’t have to add a reference.

avatar image HHammerite DavidKreft · Jun 29, 2018 at 08:46 PM 0
Share

I was asking where it is located in your project's asset's folder. You will need a reference to it in your script. For example -> Bloom is located under Assets/Scripts/PostProcessing/ you will have to include something similar to 'using Scripts.PostProcessing;' in your script where you are referencing it.

avatar image DavidKreft HHammerite · Jun 30, 2018 at 04:52 AM 0
Share

Here is the solution for post-processing but i still have problems with enabling / disabling other scripts.

zrzut-ekranu-2185.png (253.9 kB)
avatar image
0

Answer by wicke · Jun 29, 2018 at 07:36 PM

You are trying to get the script from a transform type object. Try this instead

 target.gameObject.GetComponent<Bloom>();

This is assuming. The target variable is assigned with the MainCamera's transform.

Comment
Add comment · Show 6 · Share
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 DavidKreft · Jun 29, 2018 at 07:43 PM 0
Share

It doesn't work.

avatar image Vicarian · Jun 29, 2018 at 07:43 PM 0
Share

The bloom class is missing, if you notice the error generated by VS. Resolving the component to a reference isn't the issue for the OP. I suspect his code was upgraded to a higher version of Unity somehow, where the bloom effect was removed and placed into the Post Processing Stack. The OPs unwillingness to learn the latest version of Unity is the overarching problem here.

avatar image DavidKreft Vicarian · Jun 29, 2018 at 07:47 PM 0
Share

I cannot get also other scripts.

avatar image DavidKreft Vicarian · Jun 29, 2018 at 07:48 PM 0
Share

There is a script from my old project. Everything has worked.

zrzut-ekranu-2178.png (253.4 kB)
avatar image Vicarian DavidKreft · Jun 29, 2018 at 07:54 PM 0
Share

From the editor, add a script to the project (it can be just the default template). Click into VS. You should get a dialog mentioning that the project changed on disk and needs to be reloaded. If you don't then there's something wrong with the .sln file. Delete it and the .csproj files from the project folder and have Unity recreate them.

Show more comments

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

154 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 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 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 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image

Related Questions

how to enable or disable a script via code c# 1 Answer

About takeover control 0 Answers

Enable/Disable Script on GameObject when pressing a key 1 Answer

Can't disable component, little checkbox is missing from inspector 1 Answer

Add components to a list in inspector and then activate them at runtime? 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