using { /Fortnite.com/Devices }
using { /Fortnite.com/Playspaces }
using { /Fortnite.com/Teams }
using { /Fortnite.com/Game }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /Verse.org/Verse }
using { /Verse.org/Native }
using { /Verse.org/Random }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
Game_Manager := class(creative_device):
@editable
MovementButton:button_device = button_device{}
@editable
MM_Mover:creative_prop = creative_prop{}
@editable
MM:movement_modulator_device = movement_modulator_device{}
@editable
PlayerSpawner: player_spawner_device = player_spawner_device{}
(Prop:creative_prop).ActivateKnockBackEffect(Agent:agent)<suspends>:void =
if(Fort:=Agent.GetFortCharacter[]):
option:
Yaw := Fort.GetViewRotation().GetYawPitchRollDegrees()[0]
Pitch := 0.0
Roll := 0.0
NewRotation := MakeRotationFromYawPitchRollDegrees(Yaw,Pitch,Roll)
if(Prop.TeleportTo[Fort.GetTransform().Translation - vector3{Z:=120.0},NewRotation]):
Sleep(0.1)
MM.Activate(Agent)
Sleep(0.1)
option:
Prop.TeleportTo[Prop.GetTransform().Translation - vector3{Z:=500.0},Prop.GetTransform().Rotation]
OnBegin<override>()<suspends>:void=
MovementButton.InteractedWithEvent.Subscribe(OnButtonClick)
PlayerSpawner.SpawnedEvent.Subscribe(OnPlayerSpawned)
OnPlayerSpawned(Agent:agent):void=
if(FC:= Agent.GetFortCharacter[]):
FC.DamagedEvent().Subscribe(OnPlayerDamaged)
OnPlayerDamaged(d:damage_result):void=
if(InstigatorCharacter := fort_character[d.Target],player[InstigatorCharacter.GetAgent[]]):
OnButtonClick(Agent:agent):void=
if(FC:=Agent.GetFortCharacter[]):
option:
MM_Mover.TeleportTo[FC.GetTransform().Translation, FC.GetTransform().Rotation]
spawn:
MM_Mover.ActivateKnockBackEffect(Agent)
Yes, when you click the button it knocks the player back (well forward at the moment and I’m working to fix that), I’m trying to activate this “knockback” when a player is damaged through -
OnPlayerSpawned(Agent:agent):void=
if(FC:= Agent.GetFortCharacter[]):
FC.DamagedEvent().Subscribe(OnPlayerDamaged)
OnPlayerDamaged(d:damage_result):void=
if(InstigatorCharacter := fort_character[d.Target],player[InstigatorCharacter.GetAgent[]]):
and I’m not sure how to get it working
note - no current verse build errors