News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 21st Nov 2001, 10:58 AM   #1
RestInPieces
Registered User
 
RestInPieces's Avatar
 
Join Date: Sep. 20th, 2001
Posts: 65
Can anybody please explain trace() to me?

Hi guys, i wanted to make a trace and didnt quite understand the trace (), can somebody explain the Vars and what they are good for to me? Especially HitNormal i don't understand, and where do i put the direction i want the trace to go? And if i dont pass a StartLoc, will this loc be the classowner's location? Please help me, thx, RiP.
RestInPieces is offline   Reply With Quote
Old 21st Nov 2001, 01:15 PM   #2
Shiit
Shiit
 
Join Date: Dec. 19th, 2000
Posts: 168
native(277) final function Actor Trace
(
out vector HitLocation,
out vector HitNormal,
vector TraceEnd,
optional vector TraceStart,
optional bool bTraceActors,
optional vector Extent
);

Hitlocation is the place of the first collision with either world geometry or an actor. If nothing was hit, it'll probably be the same as TraceEnd. (or not) Remember that "out" means that this variable not only goes IN, but comes out too (in this case, it only comes out, so you use an empty var for this, and that var will contain the hitlocation after Trace is done.)
HitNormal is a vector that'll contain the normal (the line that's 90 degrees on a surface) of the surface that the Trace line crosses first.
TraceEnd is the end of the Trace line. If something was hit, it'll never reach this point. For weapons, make this quite far away. Note that this is also where you specify the direction of the Trace. If you want to do the trace in direction X, this'll have to be "Location+vector(X)*1000" (supposed that the trace starts at "Location")
Since TraceStart is optional, I suppose it'll use the location of the actor Trace was called from. Just remember that the location of weapons is never used, so when you use it in a weapon you WILL have to specify this variable.

I don't know what the last vars mean, sorry.
Shiit is offline   Reply With Quote
Old 22nd Nov 2001, 07:20 AM   #3
RestInPieces
Registered User
 
RestInPieces's Avatar
 
Join Date: Sep. 20th, 2001
Posts: 65
you said "the line that's 90 degrees on a surface".
What do you mean by that? the Angle beween the line and the surface is 90 degrees? like that:

|----------------------------- <- Normal
^
Surface

thx, RiP
RestInPieces is offline   Reply With Quote
Old 22nd Nov 2001, 09:56 AM   #4
Shiit
Shiit
 
Join Date: Dec. 19th, 2000
Posts: 168
Yes, seen from the surface, it's straight up.
Shiit is offline   Reply With Quote
Old 22nd Nov 2001, 10:40 AM   #5
RestInPieces
Registered User
 
RestInPieces's Avatar
 
Join Date: Sep. 20th, 2001
Posts: 65
Smile

Thanks.
Does anybody know what the other vars are good for?
RestInPieces is offline   Reply With Quote
Old 22nd Nov 2001, 04:22 PM   #6
Papapishu
我是康
 
Papapishu's Avatar
 
Join Date: Jun. 18th, 2001
Location: void
Posts: 2,043
Yeah, the HitLocation is quite usefull, yes?
Since it tells you where you have hit...
And the Traceend is good too, say if you wanna do a gun that has only a certain range, like the impacthammer...
Imagine if thatone had an infinite range...

Tracestart can be useful if you want the trace to start from somewhere else...
Like say your pawn has a weapon that's far away (not in the middle of the body) like on the head or feet.
Say a helmet with a laser-cannon or that he can kick someone, then you can use it to simulate a hit that comes from another angle...
The bTraceactors is a bool, so i guess that if you set it to true, it will skip any actor it comes across...

I'm not sure what extent means either...
Papapishu is offline   Reply With Quote
Old 27th Nov 2001, 06:33 AM   #7
RestInPieces
Registered User
 
RestInPieces's Avatar
 
Join Date: Sep. 20th, 2001
Posts: 65
Thanks! I think Extent has something to do with some kind of "Colissionbox" that limits the trace's length... but I'm not sure :/
RestInPieces is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:57 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer