• 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 Nov 17, 2014 at 03:39 PM by Jeff-Kesselman for the following reason:

Question asks others to write their script for them.

avatar image
0
Question by hamburger891 · Nov 17, 2014 at 03:36 PM · collideraienemycolor change

Enemy Color Change Help!

Hi! I am making a game but i have a problem... How can i for example if i have one cube that collides with the other cube (the enemy), how can i make the enemy turn color to red for a second then it turns back to its original color (white)? Paste the code in the comments and THANK YOU!

Comment
Add comment · Show 3
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 KingMuffin... · Nov 17, 2014 at 03:37 PM 0
Share

you could try renderer.color

avatar image fafase · Nov 17, 2014 at 03:38 PM 0
Share

I was about to keep that one off the since it is already existing many times.

avatar image Jeff-Kesselman · Nov 17, 2014 at 03:40 PM 0
Share

I closed after we answered because he has made no attempt to solve it himself.

We gave him some breadcrumbs,, he should follow them and see where they lead.

1 Reply

  • Sort: 
avatar image
0

Answer by Jeff-Kesselman · Nov 17, 2014 at 03:38 PM

We don't write code for you here and posts that ask for complete scripts are generally rejected.

To change color you need to set the renderer.material,color field see: http://docs.unity3d.com/ScriptReference/Material-color.html

For a delayed effect you can use the Invoke method with a time delay. http://docs.unity3d.com/ScriptReference/MonoBehaviour.Invoke.html

Try to write your script yourself and, if you cannot get it to work, post what you tried here along with an expaination of what went wrong and the complete text of any unity errors.

Comment
Add comment · 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

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How can I make my enemy stay on the ground and collide with other objects? 2 Answers

enemy awareness with colliders? 1 Answer

Enemy gets through wall over time, colliders working. 1 Answer

A question about AI 0 Answers

Is the Player Being Looked at 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