BulletTrace

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
thader2005
CJ Wannabe
CJ Wannabe
Posts: 12
Joined: May 24th, 2008, 9:31 am

BulletTrace

Post by thader2005 » May 29th, 2008, 9:18 pm

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

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: BulletTrace

Post by Drofder2004 » May 30th, 2008, 12:04 am

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".
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests