1
0
KF2-Dev-Scripts/KFGameContent/Classes/KFStaticMeshActor_TrackLocalPC.uc
2020-12-13 18:01:13 +03:00

33 lines
1.0 KiB
Ucode

//=============================================================================
// 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
}