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

Dash function with character controller?

Discussion in 'Scripting' started by Resilo, Jan 15, 2017.

  1. Resilo

    Resilo

    Joined:
    Dec 8, 2016
    Posts:
    139
    So i have a dash function i know it works because it use to use the lerp function and worked fine. but the needs of my game require that a character controller be used. what function would be the best to move my character from point A to Point b at a specified speed. Or is there a better way to lerp that takes into account the character controller?

    i need the character controller so its not possible to dash through a wall

    my attempt ended up like this but it does nothing

    Code (CSharp):
    1.         if (dashnow == true && dashforward == true)
    2.             {
    3.             attackanimaton.SetInteger("Dashtype", 1);
    4.             myplayer.Move(Vector3.forward * dashspeedstat * Time.deltaTime);
    5.         }
     
  2. RgamesOffical

    RgamesOffical

    Joined:
    Jan 1, 2018
    Posts:
    2
    Im gonna need the whole C# Script to help.