Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Help - Perspective camera and move in squares

Discussion in '2D' started by Deleted User, May 21, 2015.

  1. Deleted User

    Deleted User

    Guest

    Hello everybody . how can I set up a game like the image below , however in 2D. what I need is a camera in perspective to show the scenery a little inclined , it is possible ? how can I do that ?

    Another thing , how to make the player walk square by square equal the game of this image ( Chocobo Dungeon ) ?

     
    Last edited by a moderator: May 21, 2015
  2. Gardes

    Gardes

    Joined:
    Apr 7, 2015
    Posts:
    46
    A simple square movement is not so hard. Just get the square position by mouseclick and let the player MoveTowards the target.

    The Tile code could be like
    Code (CSharp):
    1.     void Update () {
    2.         player.transform.position = Vector3.MoveTowards (player.transform.position, target, speed * Time.deltaTime);
    3.     }
    4.    
    5.     void OnMouseDown () {
    6.         target = transform.position;
    7.     }
    8.  
    This is just pseudo code to get you an idea.

    And about the camera.. Hmm I don't get your problem here. Just play with the camera values, until you like it.
     
    Deleted User likes this.
  3. Deleted User

    Deleted User

    Guest

    nice code. I think I get it. about the camera, its possibel to make it on 2D, or I need to change to 3D?

    if I need to use 3D, can I use sprites 2D, maybe make a 2.5D game right?