Skip to content

Instantly share code, notes, and snippets.

@Bobbias
Created June 11, 2012 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bobbias/2908542 to your computer and use it in GitHub Desktop.
Save Bobbias/2908542 to your computer and use it in GitHub Desktop.
class MyPawn extends UTPawn;
simulated function bool CalcCamera(float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV)
{
local vector start, end, hl, hn;
local actor a;
start = Location;
if (Controller != none)
{
end = Location - Vector(Controller.Rotation) * 192.f;
}
else
{
end = Location - Vector(Rotation) * 192.f;
}
a = Trace(hl, hn, end, start, false);
if (a != none)
{
out_CamLoc = hl;
}
else
{
out_CamLoc = end;
}
out_CamRot = Rotator(Location - out_CamLoc);
return true;
}
defaultproperties
{
Begin Object Name=WPawnSkeletalMeshComponent
bOwnerNoSee=false
End Object
Name="Default__MyPawn"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment