Search Unity

Isometric pick up/hold over head

Discussion in '2D' started by kennyrogertaer, May 22, 2019.

  1. kennyrogertaer

    kennyrogertaer

    Joined:
    May 21, 2019
    Posts:
    6
    I'm currently working on a bit of a passion project using the new isometric grid tilemap and ended up thinking ahead to some functionality I'd like to implement but can't quite get the logic down in my head.

    Similar to how in Stardew Valley you can pick up an item in 2D and hold it over your head, how would I go about doing that in an isometric game?

    The item has sprites for all 8 directions along with the main character, and the movement script for the character has variables that I could use as it keeps track of the current direction the player is facing (as well as what animation to play), so I can see how I'd keep the item facing the right direction, but how would I get the item "on top" of the player as they run around with it?

    Anyone got any ideas? Perhaps there's already a built-in way to do this?
     
  2. Dedi6

    Dedi6

    Joined:
    Jan 20, 2019
    Posts:
    119
  3. kennyrogertaer

    kennyrogertaer

    Joined:
    May 21, 2019
    Posts:
    6
    Huh... That makes sense lol. Once parented though, how would I make it look like the character is holding it above his head? I'm assuming I'll have to transform.Translate(Vector3....) it as needed?

    Thanks for the help! I knew it was gonna be simple and I was overthinking it >.>
     
  4. Dedi6

    Dedi6

    Joined:
    Jan 20, 2019
    Posts:
    119
    Hmm yea, just change the transform position of the child object, and the animation for your player.