55 lines
1.6 KiB
Lua
Raw Normal View History

2025-01-04 23:00:19 +08:00
---@class BP_Trampoline_C:AActor
---@field Box UBoxComponent
---@field Cube UStaticMeshComponent
---@field ParticleSystem UParticleSystemComponent
---@field DefaultSceneRoot USceneComponent
---@field Impulse FVector
--Edit Below--
---@type BP_Trampoline_C
local BP_Trampoline = {};
function BP_Trampoline:ReceiveBeginPlay()
self.SuperClass.ReceiveBeginPlay(self);
if UGCGameSystem.IsServer() then
UGCSystemLibrary.BindBeginOverlapFunc(self.Box, self.LaunchPlayer, self)
end
end
function BP_Trampoline:LaunchPlayer(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult)
if UE.IsValid(OtherActor) then
UGCLogSystem.Log("[BP_Trampoline_LaunchPlayer] Player:%s", tostring(OtherActor.PlayerKey))
--OtherActor:LaunchCharacter(self.LaunchVelocity, false, false)
--local TargetLocation = VectorHelper.Add(OtherActor:K2_GetActorLocation(), {X = 0, Y = 0, Z = self.Height})
--OtherActor:ExtraLaunchCharacter(TargetLocation, 1.5)
OtherActor:GetMovementComponent():AddImpulse(self.Impulse, true)
-- UGCLogSystem.Log("[BP_Trampoline_LaunchPlayer] Finish LaunchVelocity:%s", VectorHelper.ToString(self.LaunchVelocity))
end
end
--[[
function BP_Trampoline:ReceiveTick(DeltaTime)
self.SuperClass.ReceiveTick(self, DeltaTime);
end
--]]
--[[
function BP_Trampoline:ReceiveEndPlay()
self.SuperClass.ReceiveEndPlay(self);
end
--]]
--[[
function BP_Trampoline:GetReplicatedProperties()
return
end
--]]
--[[
function BP_Trampoline:GetAvailableServerRPCs()
return
end
--]]
return BP_Trampoline;