68 lines
1.5 KiB
Lua
68 lines
1.5 KiB
Lua
---@class BP_Whirlwind_C:AActor
|
|
---@field ParticleSystem UParticleSystemComponent
|
|
---@field DefaultSceneRoot USceneComponent
|
|
---@field Speed float
|
|
--Edit Below--
|
|
local BP_Whirlwind = {
|
|
EnableMove = false
|
|
};
|
|
|
|
|
|
function BP_Whirlwind:ReceiveBeginPlay()
|
|
self.SuperClass.ReceiveBeginPlay(self);
|
|
if self:HasAuthority() then
|
|
|
|
EventSystem.SetTimer(
|
|
self,
|
|
function()
|
|
UnrealNetwork.CallUnrealRPC_Multicast(self, "MulticastRPC_EnableMove")
|
|
--self.EnableMove = true
|
|
end,
|
|
1.0
|
|
)
|
|
|
|
EventSystem.SetTimer(
|
|
self,
|
|
function()
|
|
self:K2_DestroyActor()
|
|
end,
|
|
2.0
|
|
)
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function BP_Whirlwind:ReceiveTick(DeltaTime)
|
|
self.SuperClass.ReceiveTick(self, DeltaTime);
|
|
--self:GetOwner()
|
|
if not self:HasAuthority() and self.EnableMove then
|
|
local MoveLocation = VectorHelper.Add(self:K2_GetActorLocation(), VectorHelper.MulNumber(self:GetActorForwardVector(), self.Speed * DeltaTime))
|
|
self:K2_SetActorLocation(MoveLocation, false, nil, false)
|
|
end
|
|
end
|
|
|
|
function BP_Whirlwind:MulticastRPC_EnableMove()
|
|
self.EnableMove = true
|
|
end
|
|
|
|
--[[
|
|
function BP_Whirlwind:ReceiveEndPlay()
|
|
self.SuperClass.ReceiveEndPlay(self);
|
|
end
|
|
--]]
|
|
|
|
--[[
|
|
function BP_Whirlwind:GetReplicatedProperties()
|
|
return
|
|
end
|
|
--]]
|
|
|
|
--[[
|
|
function BP_Whirlwind:GetAvailableServerRPCs()
|
|
return
|
|
end
|
|
--]]
|
|
|
|
return BP_Whirlwind; |