How to make movement modulator activate when player is crouched.

I am new to UEFN and Verse. I already consulted the “Unreal Editor for Fortnite Documentation” and still cannot wrap my head around it all. I want to have the movement modulator I have placed (movement_modulator_device) activate on the said player whenever they crouch. Then deactivate when returning from the crouched position. I tried already to have the movement modulator somehow interact with the CrouchedEvent function but no matter how I type it I seem to be getting an error. I am new to this and without any prior coding experience it seems a bit challenging. My end goal is to have the players move faster when crouching instead of sprinting.

This is a simple example of how to do what you’re describing

using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

hello_world_device := class(creative_device):

    @editable MovementModulator:movement_modulator_device = movement_modulator_device{}

    OnBegin<override>()<suspends>:void=
        if (FirstCharacter := GetPlayspace().GetPlayers()[0].GetFortCharacter[]):
            FirstCharacter.CrouchedEvent().Subscribe(HandleCrouched)
        

    HandleCrouched(Character:fort_character, Started:logic):void=
        if (Started?):
            if (Agent := Character.GetAgent[]):
                MovementModulator.Activate(Agent)
1 Like

The entire

OnBegin():void=
if (FirstCharacter := GetPlayspace().GetPlayers()[0].GetFortCharacter[]):
FirstCharacter.CrouchedEvent().Subscribe(HandleCrouched)

portion is underlined in red as if it was giving an error, is there anything i did wrong?

It states “This function overrides a superclass function but has no attribute(3523)”

Not sure if I shoulda used a reply instead but do you have any idea what I did wrong or why your solution isn’t working in my case? This is a blank island at the moment with the only devices being placed is the one with the verse script and the movement modulstor.

For some reason the pasted format of what I posted was hiding the attributes which should be on the OnBegin function. I’ve updated the original post