Question by
NerevarZero · Aug 15, 2020 at 02:59 AM ·
scripting beginnerplayer movement
How can I prevent the trail rendering when pressing a specific key via Script?
Hello, I'm sure this can be solved with a simple script but I can't figure out how to do it myself.
The problem is easy.
I'm currently using the trail renderer to simulate a spaceship thrust. It looks great until you press S and go backwards, making the trail go in the opposite direction. Of course, it doesn't look good. So I thought in making a script that turns off the trail render complement when pressing the backwards key, which is S or Down Key by default.
Another solution I found was making the trail width drop to 0 on the same case, but it doesn't work on my project, so I need a script made for this one.
Could anyone show me how to script this?
Comment