Frogger3140

TorqueScript GetID

Jul 14th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. function player::getTarget(%this, %dist)
  2. {
  3. if(%dist !$= %dist * 1 || 0 > %dist || %dist > 200)
  4. {
  5. %dist = 200;
  6. }
  7. %start = %this.getPosition();
  8. %vec = vectorScale(%this.getEyeVector(), %dist);
  9. %end = vectorAdd(%start, %vec);
  10. %raycast = containerRayCast(%start, %end, $Typemasks::All);
  11. return getWord(%raycast, 0);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment