In a game that I’m making, I have bullets with a Trail Renderer attached, so there’s a white trail behind the bullet. What I’m trying to achieve is make it so the trail of the bullet turns orange when you use a power-up.
function Update()
{
if(RatePowerup.powerActive == true)
{
//Change color of the bullet trail to orange
} else
{
//Change color back to white
}
}
This script is attached to the Bullet object. “powerActive” is a static variable in the script attached to the power-up. Can anyone help? Thanks!
It is not possible to change the color of the Trail Renderer.
Workaround is:
Put an empty child game object under your bullet named “OrangeTrail” and attach a trail renderer with orange color to it and make the trailer renderer component disabled, then: