I'm trying to get 5 raycast systems to work but I'm having difficultly trying to offset them.
What I'm trying to do is to have a raycast come from my Input.mousePosition, but also have 4 other raycasts around that, that are slightly offset. But I suck when it comes to vectors.
So basically, this is how I want my set up:
This obversely isn't going to work, but thats what I am trying to achieve. So each raycast that is being shot from the Input.mousePosition is to be offset by +2/-2. I also have a feeling that it has nothing to do with the 'hit', but is to do with the ray that I need to be adjusting?
I would appreciate any help with this.
------ UPDATE ------
Okay, so I'm making some progress. I have 5 raycasts that are shot with an offset from the camera, but towards the other end of the shot, they are angling towards each other. Here is a screen shot to help explain:
Here is my current code:
I believe I have finally done it - I needed to also give each raycast a unique RaycastHit variable:
I'm not 100% if its working, but it certainly looks like it according to the debug lines.
answered Jul 02 '11 at 05:51 PM
hello. I believe you may need to change these lines:
as these are the other end of your line and they all point to the same location. I'm not 100% sure as I dont have any of my scripts to hand but that's what I would try first. Good luck
answered Jul 02 '11 at 12:10 PM