Zylos Xenos wrote:
hope this helps.[/center]
No. No, that doesn't work.
MINI-MINI tutorial: How to use an ObstacleRay (the only one I've ever used, but the same should apply to other types)
An ObstacleRayCast returns a number corresponding to how long the ray went before it collided with an object, and the syntax is as follows:
(variable) = SceneMan:CastObstacleRay(
[Vector starting position],
[Vector direction to cast ray along],
[Vector reference (you can make an empty vector) to fill in the coordinates of the first obstacle encountered, if applicable, or end of ray],
[Vector reference (can make empty) to fill in the last free coordinates before the ray hit non-MOs, if applicable, or end of ray],
[A MOID to ignore, children will also be ignored],
[Material ID to ignore hits with],
[How many pixels to skip in between checks (0 will check every pixel, IE, slower)]
);
Put it all together and it looks like this:
self.length = SceneMan:CastObstacleRay(self.Pos, self.Vel * 150, Vector(0, 0), Vector(0, 0), self.ID, 0, 5);
In case you haven't found it already, that and other types of rays can be found documented
here.