Input Problem

I’m trying to do simple character move.I use “self.accept” for input here is my codes.

self.accept("w",self.MoveForward)
        self.accept("s",self.MoveBackward)
        self.accept("a",self.MoveLeft)
        self.accept("d",self.MoveRight)
        
   
              
    def MoveForward(self):
       self.model.setPos(self.model.getX(),self.model.getY()+5,self.model.getZ())
       self.model.loop('walk')
       

    def MoveBackward(self):
       self.model.setPos(self.model.getX(),self.model.getY()-5,self.model.getZ())
       self.model.loop('walk')

    def MoveRight(self):
       self.model.setPos(self.model.getX()+5,self.model.getY(),self.model.getZ())
       self.model.loop('walk')
    def MoveLeft(self):
       self.model.setPos(self.model.getX()-5,self.model.getY(),self.model.getZ())
       self.model.loop('walk')

But when i try it , i pressed “w” but character dont move when i release the “w” character moves for +5 / -5 and stop.But i want while i pressed “w” character should move and when i released it character should stop.Like a FPS control.Anyone help me with a simple character controller ?

Thanks.Sorry for my bad english , i’m from Turkey.

Welcome to the forums! Look at the Roaming Ralph example.

Thnx for reply , i will look the sample :slight_smile:.