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 castleforce · Oct 10, 2011 at 09:19 AM · materialplayerenemyradius

Changing Player & Enemy Material when a button is pressed.

Hey Unity Users.

I'm trying to work out how to change the players metaral as well as the enemys one when a button "space" is pressed within a certain radius.

So what I really am saying is that I want to try and get:

The players material to change for a short period of time. The enemys to change and stay that way. Also creating a new material in between both the enemy and player.

Is there a possible way of doing this? I have been thing about it for a few day now and nothing I seem to come up with works.

Warm Regards CastleForce.

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 syclamoth · Oct 10, 2011 at 09:45 AM 0
Share

What do you mean, 'in between'? Do you mean fading between two textures? You can use transform.renderer.material for the rest of that stuff, but making a material which smoothly fades between one and another texture takes a special shader.

avatar image castleforce · Oct 11, 2011 at 12:29 AM 0
Share

Well I have it so when the player breaths in the blows out the air and a image of wind is rendered then the enemies material changes. Then the wind image fades away.

I don't think that sounds right sorry.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by timsk · Oct 10, 2011 at 09:46 AM

http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=material

In particular look at Material.GetTexture and Material.CopyPropertiesFromMaterial is also usefull

Comment
Add comment · Show 1 · 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 castleforce · Oct 10, 2011 at 11:57 AM 0
Share

Thanks, I'll look into them.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Instantiate enemies around player 1 Answer

Rotate object around player when space is pressed. 1 Answer

Attack within 0.61 meters? 1 Answer

Player lives script 1 Answer

Enemy is not moving to player with A* pathfinding 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