No announcement yet.

Laser Emitter: How to get different colors?

  • Filter
  • Time
  • Show
Clear All
new posts

    Laser Emitter: How to get different colors?

    So I've made a beam emitter using the tutorial here. I've made a few tweeks to the look of the emitter, and this is my current set up:



    So what I want to do is set it up so that I can change the color of the laser though matinee (or some other method so that I don't have to make separate particle systems/materials for each color I want.

    Sorry to say I am a noob when it comes to working with materials, so if anyone has links to guides, tutorials or videos for making materials and using matinees to change them in similar ways, or if they know a general set-up that would make this work, I'd be greatly appreciative!

    What I have tried to do so far (unsuccessfully) is this:

    In my material (named "LaserMaterial"), I set a VectorParameter named "Laser_Color" with it's R, G and B values set at 30 in the original material. I then created a MaterialInstanceConstant with LaserMaterial as it's parent. This allowed me to change the color of the laser using the InstanceConstant, which is close to what I want, but it feels like I'll still have to make extra copies of the particle system in order to get different colored lasers, and I won't be able to change them dynamically like I want. At this stage, I would need one MaterialInstanceConstant and one Particle System for each laser color I wanted to have.

    I tried then to set up a MaterialInstanceActor inside my level, associate it with my InstanceConstant material and control it via matinee. I made a matinee with a Vector Material Param Track, set the Param Name as "Laser_Color" (same as the VectorParameter in the original material), and tried to change the values using the curve editor, but I did not see any change in the laser in my level. I assume I have something wrong somewhere in the material.

    I also tried changing the "Initial Color" in Cascade to alter the color of the laser, but it did not work. I know this is because of an issue with my material, but I don't know how to fix it. If somebody could aid me in fixing that (so I can change the InitialColor), then I could alter the color of the particles themselves using matinee (as far as I'm aware) and get a similar desired effect.

    Any help will be greatly appreciated! ^_^ Thank you ahead of time.

    ~ RCT

    Update: so I learned how to use a Vertex Color in the material in order to allow editing of the color through Cascade using the Initial Color setting, and when I tried setting the initial color to use a Particle Parameter, it allows me to change the color of the laser for each individual emitter actor in the level.

    Problem is, I still can't change the color of the laser through matinee. When I try, using a "Float Particle Param Track", it only gives me 1 axis to change (rather than 3). I can set it to 0 or 1 to make the laser invisible or visible, but what I want to do is control the color dynamically. Anybody have any ideas? xD I feel like I'm making some progress as I go along here.




        particle dynamic parameter


          I followed your tutorial, and it worked when using a material on a static mesh, but it did not work on the emitter that used the same material. Any ideas for a work-around?

          I would assume the emitter is not updating because the beam created is not dynamically applying the material the same way the static mesh is. However, one would think that the spawn rate of the emitter would allow it to update the material based on the spawn rate, but this doesn't seem to be the case. I assume it's a problem that can be fixed within the particle system in cascade.