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 haroonalam · Sep 30, 2011 at 11:41 AM · c#gridplane

How can I make grid tiles/plane transparent

Hello guys. I have made a grid using multiple planes. Now I want to place a image on this grid so that user cant see the grid I have made and I ll have access of all points of the image using grid.

The problem is I am unable to place image on it, it shows me grid that I made before. I have tried Materials/Shader -> Transparent/Diffuse, but some blocks are still visible. How can I make grid tiles transparent ?

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
0
Best Answer

Answer by Owen-Reynolds · Sep 30, 2011 at 03:24 PM

Setting Transparent->Diffuse tells Unity that if the texture happens to have some transparent parts, actually make them transparent, instead of just white. So, it will work if your texture happens to be completely transparent.

Probably set MainColor's alpha to 0, in the material, using the Inspector. That will make any texture completely transparent. If you want a square to turn faint blue when it's selected, use a small white texture and play with MainColor in code (faint blue = (0, 0, 1, 0.25), etc... .) I'm assuming you have the big picture "behind" the see-through boxes.

If you never want to see the squares, remove the MeshRenderer. The collider will still be there, for raycasts or whatnot, it will simply skip the entire draw step.

Default Unity planes use a mesh collider, which in theory is slower. Their plane has 200 tris, but it might use some shortcuts. Very short cubes do the same job as planes and might run a little faster (they use box colliders.)

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 haroonalam · Sep 30, 2011 at 07:23 PM 0
Share

Thanks owen, I ll try it on my very next working day and let you know. One more question I want to ask, I am making a tower defense game and a grid is needed, so that I can access every point of it. What basically I am trying to implement is:

$$anonymous$$aking multiple planes in form of 2D array and placing my actual image($$anonymous$$ap) on it, in this way I am accessing the specific point for game operations. so my approach is right ? I ll appreciate your help.

avatar image Owen-Reynolds · Oct 01, 2011 at 03:34 AM 0
Share

You may be able to use (for example) a 40x40 array in your code, without having to actually create and place 40x40 gameObjects.

For example, ins$$anonymous$$d of a mouse-rayCast to check the box you hit and read the grid coords from it; ins$$anonymous$$d you can mouse-RayCast to the ground and use the world x/z where you hit to compute the grid coords.

To check if someone can place a tower there, can check $$anonymous$$ap[x][z]==0 without having to do any rayCasting.

Even if you want to "light up" the space they pick, you can move a single box around. If you want to light up all the spaces they can move to, say, then you probably need to create all those transparent gameObjects.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Plane - 10x10 grid - Questions about it. 1 Answer

A node in a childnode? 1 Answer

What is grid in unity and how can I implement it ? 1 Answer

C# Plane Detecting a Gameobject 1 Answer

C# Plane Collision Detection 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