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

Mouse click movement with isometric artwork

Discussion in 'General Graphics' started by Lethn, Jan 31, 2018.

  1. Lethn

    Lethn

    Joined:
    May 18, 2015
    Posts:
    1,583
    I've got a bit of a random question, I've been trawling through some old games for fun because I like playing old games to keep me inspired for ideas and work out good game mechanics. One thing I've been fascinated by is the old Fallout games specifically. I want to know how on earth the game would calculate a mouse click and have the engine know which way for the sprite to face.

    I became so obsessed with this when I noticed that in Fallout the character sprite, even if they were going directly downwards would quickly switch to a left and right angle faced position as they went down the map. Is this some sort of grid based system? I'm curious to know how they did it.

    It's a bit difficult for me to explain so I found a video and timestamped an example of this happening.



    I've always really liked isometric art and so on so it would be nice to know the maths behind all of this, the RPG stuff of course already has loads of tutorials.

    Edit: Oh wait, now I think about it maybe I should have put this in the scripting category.
     
  2. BinaryX

    BinaryX

    Joined:
    Aug 4, 2014
    Posts:
    55
    This may help you with this, it sure did help me when i needed isometric 2d mechanics. The tutorial is in Flash but it's easily adaptable to Unity. This explains how the map is set up, how the buildings and character sprites are set up and how a screen position (a click in screen space maybe) can be converted to a position on the grid ( yes, it's a grid, sort of ).

    https://gamedevelopment.tutsplus.co...ds-a-primer-for-game-developers--gamedev-6511
     
  3. Lethn

    Lethn

    Joined:
    May 18, 2015
    Posts:
    1,583
    Ahhhh! Thank you, got some visual representation of the grid and everything, that makes sense, you know what? I think I can also work it out from this post like you say. The movement isn't too difficult to figure out, that will just be a mouseclick and a pathfinding algorithm and it looks like the post does a good job of explaining the sprites which is the main problem I was thinking of.

    This is a really good post you've found, but unfortunately it's too simple the movement I'm looking at, I'm specifically wondering how you would make the direction face the right way depending on the path it was following.

    Hmm, dunno, maybe I just need to research some of the keywords they're talking about.
     
    Last edited: Feb 1, 2018