Showing posts with label particle texture. Show all posts
Showing posts with label particle texture. Show all posts

Sunday, November 27, 2011

Triple Feature: Particle Texture Fade

Here's a solution to something that annoyed me for weeks.

One of the player's weapons fires what can best be described as lightning rings. They can bounce off walls. When they explode, they expand and fade away.

Or…they're supposed to fade away. In practice, this happens:
The rings expand, but they don't become more transparent, and they don't disappear. For some reason, the unity scripting language can't find the color attribute of the explosion material.

Yeah…some reason. In the unity programming language, you reference most material's colors with this:
renderer.material.GetColor("_Color");
Or, more simply…
renderer.material.color

But that doesn't work with materials that use particle shaders.

After extensive investigation, some experimentation, and a failed attempt to use a script I got off the 'net, I concluded that particle shaders don't have the color attribute. So, the question is, what do they have?

I managed to find a script for a particle shader, and found that they have this:

renderer.material.GetColor("_TintColor");


Bam, problem solved.





Triple Feature: Progress Report

Well…it's been a while. I've made some progress since I last posted.

I've written AI scripts for enemy behavior. The Seraph I showed you now has two different attacks – a claw slash and a laser projectile shot – which she uses in several different fashions. She can figure out the player's position and respond accordingly. If she's close to you, she'll lunge and try to tear you to shreds with her claws, alternating between a left hand claw animation and a right hand claw animation. If she's at a distance, she'll blast you with her laser. If she's above you, she'll go on a bombing run, circling like a vulture and shooting her laser beams. She even leads her fire.

I've tweaked the player's behavior. The hero will now smoothly aim her gun up and down, and, when strafing, aim forward instead of the direction she's moving. She can be knocked down by powerful enemy attacks. If she's flat on her back, she recovers with that stylish jump-flip sort of motion that ninja and martial artists are so fond of these days. If she's face down, she can roll to the side to avoid people fightin' dirty.

I've modified the status screen, or heads up display, or whatever you want to call it. The hero's life bar is very nifty now. It goes up and down as she takes damage or gets healing items, and it does so gradually – I'll show what I mean later if I feel like it.

I've also worked on the player's weaponry. She has two…no, wait, three…different ranged weapons, and I'm starting to work on her melee weapon.

Perhaps most importantly, I've gotten a firmer idea of how the game will work. I've come up with concepts for equipment that the player will get and how it will be used for combat, exploration, and puzzle solving.

But you're not here for a progress report, are you? I didn't think so. You want tips on how to make two different visual effects work in unity. I will provide…In the next two posts.