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 post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by Keavon · Apr 06, 2011 at 02:27 AM · errorscreenflashredbce0017

Screen Flash When Hit -- Error Help From Pervious Question's Answer

Hello. I am trying to make my screen flash red when I'm hit. I am following the first answer for this question: http://answers.unity3d.com/questions/24529/screen-flashes-red-when-taking-damage

I am getting an error though. I applied the given script, changing "GUITextureobjectname" on the 4th and 2nd to last lines to it's name in the Hierarchy. But I am getting this error:

Assets/Game Assets/Hit.js(15,10): BCE0017: The best overload for the method 'Hit.Fade(float, float, float, UnityEngine.GameObject)' is not compatible with the argument list '(int, float, float, System.Type)'.

and this error:

Assets/Game Assets/Hit.js(17,10): BCE0017: The best overload for the method 'Hit.Fade(float, float, float, UnityEngine.GameObject)' is not compatible with the argument list '(float, int, float, System.Type)'.

and I am unable to enter play mode.

I am calling the script with FlashWhenHit(); (outside of that script).

Can somebody tell me what I am doing wrong? Do I need to replace the value "float" for something, and if so, what?

Again, thank you!
:P

-Keavon

EDIT
EDIT
EDIT
EDIT
EDIT
EDIT

Thank you for your answer, efge, and Marowi for helping me understand it.

I have fixed it and it got rid of the error, but now I am getting:

Assets/Game Assets/Hit.js(15,10): BCE0017: The best overload for the method 'Hit.Fade(float, float, float, UnityEngine.GameObject)' is not compatible with the argument list '(float, float, float, System.Type)'.

And...

Assets/Game Assets/Hit.js(17,10): BCE0017: The best overload for the method 'Hit.Fade(float, float, float, UnityEngine.GameObject)' is not compatible with the argument list '(float, float, float, System.Type)'.

What should I do now? I suck at scripting, and I have never really gotten outside the cardboard box with it, so to speak.

Thank you so much for you input!

-Keavon

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by efge · Apr 07, 2011 at 06:17 AM

The arguments of your function Fade are Floats and a GameObject,
so you should change the calls to this:

Fade (0.0, 0.8, 0.5, GUITextureobjectname);
Fade (0.8, 0.0, 0.5, GUITextureobjectname);
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 Keavon · Apr 08, 2011 at 03:08 AM 0
Share

Hey, thanks for your response, but I don't get what you mean. Where should that go? Because I have that already on line 15 and 17, with line 16 being yield WaitForSeconds (.01);. Isn't that what I already have, or does that go elsewhere? Thanks!

avatar image · Apr 08, 2011 at 06:39 AM 2
Share

The first 3 arguments passed to Hit.Fade() must be floats. On line 15, you're using (int, float, float... and on line 17, you're using (float, int, float...

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

No one has followed this question yet.

Related Questions

Screen flashes red when taking damage 3 Answers

Red flash for each network player when he gets hit 1 Answer

Cannot run anything in iOS. No errors! 0 Answers

Mouse look script help 1 Answer

problem with GUI errors and screen resolution 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