Announcement

Collapse
No announcement yet.

Barriers in widget

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Barriers in widget

    I'm creating a maze game inside of a widget, where you have a player that has to navigate through the maze and get to the end. Problem is the player can go outside the bounds of the maze, is there a way to add triggers and collision barriers so the player is constricted to an area?

    #2
    Originally posted by IcyFlqmes View Post
    I'm creating a maze game inside of a widget, where you have a player that has to navigate through the maze and get to the end. Problem is the player can go outside the bounds of the maze, is there a way to add triggers and collision barriers so the player is constricted to an area?
    I don't see a reason why you want to do this only in widgets, but you can always restrict the camera, and anything you move across the screen, depending on x/y values. If you have the player pawn/character moving on the screen you could spawn collision volumes or collision boxes, but really this can be done entirely without widgets. If you want a widget overlay, this can be in place without affecting the player movement. Widgets do not interact with the player or any other pawn/actor, they are a 2D interface layer.
    LEGENDS OF EPICA | CS - SPACE ALPHA

    Comment


      #3
      Depending on what you are looking for, you could have a grid of cells (A data structure), and restrict the player's movement to those cells. Each cell would have a state (Blocking / Non blocking), and you could create a reusable collision widget that sets the states of all cells that it encapsulates to blocking in the parent. When the player tries to move, you would check the state of the cell that they are trying to move into, and disallow the movement if it is blocking. You could even go further and add other gameplay based on additional cell states.
      Marketplace Assets

      Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
      Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
      Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

      Comment


        #4
        Originally posted by unit23 View Post

        I don't see a reason why you want to do this only in widgets, but you can always restrict the camera, and anything you move across the screen, depending on x/y values. If you have the player pawn/character moving on the screen you could spawn collision volumes or collision boxes, but really this can be done entirely without widgets. If you want a widget overlay, this can be in place without affecting the player movement. Widgets do not interact with the player or any other pawn/actor, they are a 2D interface layer.
        Thanks for your response! I attempted to do it outside of a widget, but I need it to be in a widget for a couple reasons

        Originally posted by Jamendxman3 View Post
        Depending on what you are looking for, you could have a grid of cells (A data structure), and restrict the player's movement to those cells. Each cell would have a state (Blocking / Non blocking), and you could create a reusable collision widget that sets the states of all cells that it encapsulates to blocking in the parent. When the player tries to move, you would check the state of the cell that they are trying to move into, and disallow the movement if it is blocking. You could even go further and add other gameplay based on additional cell states.
        This sounds like it'll definitely work for what I need, thank you!

        Comment

        Working...
        X