1
0
KF2-Dev-Scripts/KFGameContent/Classes/KFStaticMeshActor_TrackLocalPC.uc

33 lines
1.0 KiB
Ucode
Raw Normal View History

2020-12-13 15:01:13 +00:00
//=============================================================================
// KFStaticMeshActor_TrackLocalPC
//=============================================================================
// Custom visual class that tracks and rotates to look towards the local PC.
// Used for map effects.
//=============================================================================
// Killing Floor 2
// Copyright (C) 2017 Tripwire Interactive LLC
// - Dan Weiss
//=============================================================================
class KFStaticMeshActor_TrackLocalPC extends DynamicSMActor
placeable;
simulated event Tick(float DeltaTime)
{
local PlayerController PC;
super.Tick(DeltaTime);
if (WorldInfo.NetMode != NM_DedicatedServer)
{
PC = GetALocalPlayerController();
if (PC != none && PC.Pawn != none)
{
StaticMeshComponent.SetRotation(Rotator(PC.Pawn.Location - Location));
}
}
}
defaultproperties
{
bUpdateSimulatedPosition=true
}