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

Question How to make my character slide tackle?

Discussion in 'Scripting' started by Dane_Bow, Aug 8, 2023.

  1. Dane_Bow

    Dane_Bow

    Joined:
    Dec 19, 2020
    Posts:
    4
    I wanted to implement this feature in my game (01:23):

    When the character is crouching and can slide and tackle his opponents.

    transform.translate didn't help, my character just keeps teleporting along the X axis and I don't know how to make transition smooth and visible.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,711
    You could look for Youtube tutorials on something like this but unless you luck out with one, it's like you'll need to roll your own logic to do any kind of custom movement like this.

    Fortunately that's fairly easy to do, and you will only do it one step at a time, so start breaking down the pieces of it into one action at a time and work on it.

    Like this guy:

    Imphenzia: How Did I Learn To Make Games:

     
  3. Chubzdoomer

    Chubzdoomer

    Joined:
    Sep 27, 2014
    Posts:
    106
    It looks like it's ultimately nothing more than a dash. There are tons of dash tutorials out there, so you can always just follow one of those and modify it to be a slide (only allow the move to be performed if the player is crouching, etc.).
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,355
    If you've already implemented basic character walking than you should already know how to make your character move. You probably didn't use transform.translate for that either, right?
     
  5. Dane_Bow

    Dane_Bow

    Joined:
    Dec 19, 2020
    Posts:
    4
    Found a better solution, since rb.velocity couldn't work properly I used Add Force.
     
  6. wideeyenow_unity

    wideeyenow_unity

    Joined:
    Oct 7, 2020
    Posts:
    728