I still cant get it working properly, but here is what it currently looks like. So I have removed all the Line Renderer stuff because I can worry about that later and I been working on what Hacky suggested. Any ideas on how I might get this working? I really just want to use it to show what angles things will bounce around at. I have even tried to use the Debug.DrawRay but to no avail. I have gotten it to sort of work with Gizmosīut I cant use Gizmos in the real thing and I am having trouble getting it to work with the LineRenderer. It seems like Vector3.Reflect is the key but I can't quite figure out how to use it properly. Reflect(position, direction, reflectionsRemaining - 1) If (Physics.Raycast(ray, out hit2, maxStepDistance))ĭirection = Vector3.Reflect(direction, hit2.normal) ĭebug.DrawRay(startingPosition, position, een) Private void Reflect(Vector3 position, Vector3 direction, int reflectionsRemaining) Reflect( + * 0.75f,, maxReflectionCount) Lr.SetPosition(1, new Vector3(0, 0, hit.distance)) If (Physics.Raycast(transform.position, transform.forward, out hit)) What I am trying to do is fairly straight forward, I am trying to display a Line Renderer that follows my bouncing/reflecting Raycast.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |