Search Unity

Looking for help regarding 2D movement.

Discussion in '2D' started by Myc0nid, Feb 11, 2020.

  1. Myc0nid

    Myc0nid

    Joined:
    Feb 11, 2020
    Posts:
    1
    I am starting a new project that is not top down. Its style is similar to that of this video. My current goal is to have the player move freely, but be facing the general direction of the mouse. It will hopefully be 8-directional. If done correctly, I want it to act similar to the character's movement in Enter the Gungeon, or Dark Souls when you're target locked, so the character can move downwards while playing the WalkUp animation if the mouse is above them, WalkRight if it is to the right, etc.. I've been unable to figure this out, and I've spent waaay to much time on this. It would also be useful to note that I'm extremely new to the scripting scene, so please be thorough if you do decide to help out. This is the code I'm working with, just so the player can drift around in the meantime. Thanks in advance for the help!
     
  2. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,465
    Since you have some basic movement already, now try making your character's sprite face the direction of the mouse. There should be plenty of videos and forums on this