Trigger if statement once until needed again

Hi.

I’d like for something to happen when my character is moving, but to only happen once until he stops and starts walking again.

I can’t seem to figure it out though.

I can’t use the Update function or the Start function. Or can I ?

Thanks!

{
    if ((player.GetComponent<CharacterController> ().velocity.magnitude > 1)) {
     
    						{
    								This happens once			
    						}
    				}

I don’t really understand what you want to do.
You can set a boolean (say, “hasDoneStuff”) to true when “this happens once” and check this boolean. Then when you’re character stops, set the boolean to false.