Page 1 of 1

BulletTrace

Posted: May 29th, 2008, 9:18 pm
by thader2005
Hi everybody

I read one tutorial about how add rain effects. There, it uses bulletTrace, this function returns an array. There is one value that is fraction what does mean it? what others values has it?.

example:

Code: Select all

trace= bullettrace(pos, pos+(0,0,-250),true,undefined);

if (trace["fraction"] !=1) playfx(.............);
thanks for all. :D

Re: BulletTrace

Posted: May 30th, 2008, 12:04 am
by Drofder2004
fraction returns the fraction of the distance. So, example

|----------X----------|
0---------.5----------1

So, if you did a bullettrace from "0" to "1" and during that bullettrace the tracer hit a solid surface or entity, it will return the fraction of the distance.

The code you linked basically says "if the bullettrace hits a surface between the two points, continue".