x


Transparent game objects

I'm working on HoMM3 clone. I use a map made of 3D tiles (they're going to be hexes soon) and wanted to use 2D graphics for all the map elements such as obstacles AND the creatures. As for now (pic related) I made a plane and added the dragon graphic to it - I use OnMouseUp() to change dragon's transform.position on the tile's one.

My only problem (for now) is that the plane or any other cube object has it's own white color (dragon's bg is transparent). Is there a way to just show graphics I need? I need them to be on GameObjects

alt text

more ▼

asked Sep 25 '11 at 12:39 PM

4illeen gravatar image

4illeen
63 33 36 38

(comments are locked)
10|3000 characters needed characters left

4 answers: sort oldest

Use a transparent shader.

more ▼

answered Sep 25 '11 at 12:58 PM

Piflik gravatar image

Piflik
5.4k 15 26 44

this makes the whole object including the picture transparent

Sep 25 '11 at 01:06 PM 4illeen

It should be transparent according to the picture's alpha channel.

Sep 25 '11 at 01:08 PM Piflik
(comments are locked)
10|3000 characters needed characters left

1- Create a Plane game object. 2- Create a material of type Particle->Alpha Blended as long as you don't need it to respond to light. 3- Use your picture as a texture for that material. 4- Assign that material to the plane.

more ▼

answered Sep 25 '11 at 03:04 PM

gshomali gravatar image

gshomali
1

(comments are locked)
10|3000 characters needed characters left

Here's how you can do it:

1- Create a Plane game object. 2- Create a material of type Particle->Alpha Blended and use your dragon image as a texture. 3- Scale down the created plane to the size suitable to your game.

Regards.

more ▼

answered Sep 25 '11 at 03:04 PM

gshomali gravatar image

gshomali
1

(comments are locked)
10|3000 characters needed characters left

Save it as PNG, with Index Transparency. Or make the BG black and use Grayscale as Alpha, first ones better though.

more ▼

answered Sep 25 '11 at 03:10 PM

unluckyBastard gravatar image

unluckyBastard
136 1 1 4

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2210
x2097
x179
x52

asked: Sep 25 '11 at 12:39 PM

Seen: 2427 times

Last Updated: Sep 25 '11 at 03:10 PM