Help with constraining a character please

Hello,

I need help keeping an actor in the boundaries of the scene and I can't remember how to do it. Please help

Thanks

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    There are lots of ways.

    One way is to set up non-moveable actors at your screen edges and add a collide in your player to collide with the edge actors.

    Another would be to put a rule in your actor like this:

    If self.position.X < 0
    
    Change self.postion.X to 0
    

    That would stop the player from moving off the left edge of the screen, you'd need to add additional rules for the top, bottom, and right edges.

  • SLOCM3ZSLOCM3Z Member Posts: 797

    Cool! Thanks @jamie_c :smiley:

Sign In or Register to comment.