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
  4. Dismiss Notice

Question FreeFlow Fighting system help

Discussion in 'Scripting' started by s0lidsnake, Sep 10, 2020.

  1. s0lidsnake

    s0lidsnake

    Joined:
    Oct 8, 2019
    Posts:
    8
    So.. I'm trying to recreate(sort of) Batman Arkham series style combat mechanic and did a lot, but now I'm stuck with such a simple thing... When enemies are further away - "far" animations kick in but I don't know how to make that sort of dash towards that enemy to a certain distance like it was in those games when an enemy is farther away from you. Like shown on GIF, when I try to attack that back enemy, just animation isn't enough to get to the enemy, that's where a little dash(to a certain distance) could come in handy I hope this makes sense, 'cause I really don't know how to explain it any better. And to just clear thing out, I did try "Vector3.MoveTowards" "transform.Translate" and "Rigidbody.AddForce" none of them helped me.
     

    Attached Files:

  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,724
    If all if your movement is controlled by animation, it's likely that any movement from those sources is simply being overwritten by the Animator.
     
  3. s0lidsnake

    s0lidsnake

    Joined:
    Oct 8, 2019
    Posts:
    8
    I know, but that's not the problem. I tried unchecking "Apply root motion" on the animator. "Vector3.MoveTowards" "transform.Translate" and "Rigidbody.AddForce" do work, but not as I need. They either move character too far or move non-stop or don't do anything at all
     
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    Try lerping the position to the target
     
  5. Bleumion

    Bleumion

    Joined:
    Aug 5, 2020
    Posts:
    2