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 Amaresh · May 07, 2014 at 08:02 PM · textureshaderstransparency3dmodel

How to a 3d character transparent?

I have a 3d character in my game. Its in fbx format. I just want to know, how can I make it transparent during collision or during some event. I don't know how to make those textures transparent.

Please Help. Thank You.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by rutter · May 07, 2014 at 08:06 PM

You're really asking two questions:

First, how do you write a script that reacts to collisions? That's complicated, but lucky for you there are dozens of good tutorials out there. If you've never written a script, before, you'll want to look up an introductory video. Once you're familiar with the basics, you can check out the OnCollisionEnter article in the scripting reference, or find another video about handling collision.

Now, as far as turning your character invisible, all you'll need to do is disable its renderer. If there is only one renderer, you can use the renderer property of your object. If there are several renderers, you can use GetComponentInChildren to find and disable all of them. Again, there are tutorials for this on the net.

You will probably also want to turn your renderers back on, so that your object becomes visible again. You could use Invoke() to call another function X seconds from now.

Comment
Add comment · Show 5 · 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 Amaresh · May 08, 2014 at 09:06 AM 0
Share

Dear @rutter u got me totally wrong here. Firstly, I know how to write a script for collision events and second, Try'n find a difference between transparent and invisible. They mean different. I'm talking about 50% alpha value of the renderer and you are talking about 0% alpha.

avatar image Noah-1 · May 08, 2014 at 09:18 AM 0
Share

I would just create a transparent material and make a swap on the event

avatar image Amaresh · May 08, 2014 at 09:37 AM 0
Share

@Noah I'll try that...Thank You for your answer

avatar image AlucardJay · May 08, 2014 at 09:45 AM 0
Share

+1

Why so angry? Actually, transparent is invisible, you are looking for a translucent effect :P

The answer by rutter still applies, find all the renderers with GetComponentInChildren. If your shader supports transparency, then simply modify the alpha value of the renderer.material.color , or else swap the renderer material as suggested by Noah1.

I'm talking about 50% alpha value of the renderer , perhaps you should have specified this in the question....

avatar image Amaresh · May 08, 2014 at 03:07 PM 0
Share

@alucardj and @rutter sorry if I sounded angry. But I've solved it using Noah's solution. Thanks all for your answer.

avatar image
0

Answer by MSpiteri · May 08, 2014 at 10:59 AM

Hello, have you tried to change the shader of the renderer when the player gets hit. ie. Place this inside your OnCollisionEnter (PS: I do not have Unity on this PC, so I might have a syntax error in the code, but it should be something like this):

 renderer.material.shader = Shader.Find( "Transparent/Diffuse" );

Then change the alpha to achieve the fading effect that you want.

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

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

24 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

Related Questions

A node in a childnode? 1 Answer

How do I properly apply a transparent texture to a mesh? 2 Answers

[ problem ] transparent shader !!! 1 Answer

How to move alpha mask along the floor plane as the user (camera) moves 1 Answer

Number of Materials Import Blender Unity 0 Answers


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