Timeline for Stopping a reflecting raycast/linerender laser
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 15, 2017 at 21:14 | comment | added | Fobok | Doing some more experimenting... it's not the early break that's causing the problem in the slightest. It does the same thing if I set the reflections to more than 2 and have no if or break in there. So, I need to rethink this whole thing from scratch and try to find a better tutorial, I guess. | |
Jun 14, 2017 at 19:32 | comment | added | Draco18s no longer trusts SE | Hmm. I'll fiddle with this for a bit, but you definitely need some way of recognizing that you've collided with a non-mirror and to terminate the loop. | |
Jun 14, 2017 at 19:27 | comment | added | Fobok | No luck. That just adds an extra bounce off of the laser model, again at a seemingly random angle. (That's assuming I re-add the ray line to the 'else', otherwise. it does nothing different at all.) I've tried multiple things to get it to do just one more round or to calculate just one last position, but it doesn't seem to work, (I even tried, admittedly by mistake, taking out the ray from the else again and setting it to nReflections - 1, but that just crashed Unity every time I hit the play button.) | |
Jun 14, 2017 at 18:37 | comment | added | Draco18s no longer trusts SE |
Probably means you need to loop one more time, try... i = nReflections instead.
|
|
Jun 14, 2017 at 18:21 | comment | added | Fobok | Thanks for helping! Unfortunately, this isn't quite a working fix. The linerenderer will no longer go to the final object, stopping at the mirror before the non-mirror object, and shoots off in the direction towards my laser emitter model again. (I also just added a line to the code to make sure that it was not set to loop, and it still happens.) 1drv.ms/i/s!Aj0TjF5ApmITj-IFExlVzqaD7YydAg | |
Jun 14, 2017 at 15:37 | history | edited | Draco18s no longer trusts SE | CC BY-SA 3.0 |
added 229 characters in body
|
Jun 14, 2017 at 15:31 | history | answered | Draco18s no longer trusts SE | CC BY-SA 3.0 |