Godot 3.2 - Tracer Blink Ability Tutorial In 2 Minutes

Поділитися
Вставка
  • Опубліковано 19 жов 2024

КОМЕНТАРІ • 38

  • @ash.n51
    @ash.n51 4 роки тому +15

    "Orange leggings not included"
    *sad cavalry noises*

  • @Ceisriel
    @Ceisriel Рік тому +5

    For Third person games with directional movement the code is :
    if Input.is_action_just_pressed("blink"):
    var forward_direction = -global_transform.basis.z
    var teleport_vector = forward_direction.normalized() * -teleport_distance
    var teleport_position = translation + teleport_vector
    var collision = move_and_collide(teleport_vector)
    if collision:
    teleport_position = collision.position
    translation = teleport_position
    This also checks collision so your players can't teleport through walls or fall through the terrain
    keep in mind that this version is adjusted to teleport your player where the camera is pointing not where the player is facing, if you use a different directional system just use your direction variable instead of "forward_direction" also change -teleport_distance by deleting the minus like this
    if Input.is_action_just_pressed("blink"):
    var teleport_vector = direction.normalized() * teleport_distance
    var teleport_position = translation + teleport_vector
    var collision = move_and_collide(teleport_vector)
    if collision:
    teleport_position = collision.position
    translation = teleport_position

  • @TangledVirus
    @TangledVirus 2 роки тому +1

    Hey, if you were having a hard time with the blinking throwing you out of the map, I got a solution that worked for me, it doesn't use raycast(Sadly that didn't work with me.)
    So here's what I did:
    if Input.is_action_pressed("dash"):
    translate(Vector3(0, 0, -1))
    if is_on_wall():
    translate(Vector3(0, 0, 5))
    Basically this means that whenever the character hits the wall, they stop moving and bounce back, like when you throw a ball to a wall. Worked for me, maybe it works for you.

  • @chef2654
    @chef2654 4 роки тому +9

    Speaking of Overwatch. Would you do a tutorial on Lucio-ish wall running?

    • @garbaj
      @garbaj  4 роки тому +3

      Oof, that's a tough one. I would love to do a video if I can figure out how to do it

    • @chef2654
      @chef2654 4 роки тому +1

      @@garbaj thanks man, keep doing what you're doing, you're videos are really helpful

  • @TheMikirog
    @TheMikirog 3 роки тому +6

    Weird how you forgot the most important thing - adding a Raycast so that you cannot go inside of walls.

    • @Ceisriel
      @Ceisriel Рік тому

      You don't need it.

  • @SophiaWoessner
    @SophiaWoessner 2 роки тому +1

    instead of putting the
    if Input.is_action_pressed("ability"):
    translate(Vector3(0,0, -warp_dist))
    inside of the movement bits just put it under _process, that way you dont have to past it as much and now you can do it while standing still

  • @rattenliebhaber7840
    @rattenliebhaber7840 4 роки тому +7

    Nice but could you make a video about it with collision detection?

  • @2bytesgoat
    @2bytesgoat 3 роки тому +1

    I find it more satisfying if you do:
    if Input.is_action_just_pressed("blink"):
    direction *= blink_dist
    seems a bit more natural ...
    thanks for the tutorial :D

    • @rafaeltota
      @rafaeltota 2 роки тому

      I did this with his updated movement script, it works on the ground but not in the air, and I have no idea how to make it work airborne :(

    • @8ocl
      @8ocl 8 місяців тому

      this helped sm, ty!

  • @romank2776
    @romank2776 4 роки тому +3

    I've tried to solve the collision issue with this addition:
    three more variables, gives the option to turn off the ability blink/pounce and the possibility to check if the player is walkin, falling, running state for the future
    export var player_can_pounce : bool = true
    export var player_pounce_speed = 50
    var player_is_walking : bool
    at the beginning of _physics_process(delta): declared a new temporary variable and set it to 1 - so it won't change any multiplications
    var player_pounce_temp = 1
    to every block of the WASD Input, I added:
    player_is_walking = true
    to get this:
    if Input.is_action_pressed("player_forward"):
    player_direction -= transform.basis.z
    player_is_walking = true
    print("player is walking - forward")
    after the WASD if Blocks, this:
    if Input.is_action_just_pressed("player_pounce") and player_can_pounce and player_is_walking:
    player_pounce_temp = player_pounce_speed
    and added the player_pounce_temp variable as a second factor to the linear interpolation:
    player_velocity = player_velocity.linear_interpolate( player_direction * player_speed * player_pounce_temp, player_accel * delta)
    after the mov_and_slide - set the player_is_walking status to false, if there has been no WASD key been pressed:
    if player_direction == Vector3(0, 0, 0):

    player_is_walking = false
    #print("player walking - false")
    until now it seems to work quite well and collision does work due to the move_and_slide()

    • @garbaj
      @garbaj  4 роки тому

      Nice, good to see that it works

  • @guilhermesouzareis9816
    @guilhermesouzareis9816 4 роки тому +4

    Great job with this series! Really escited to see the next video and wondering a few things, it's possible for a next video to the recall skill movement? and set it to be used with the same key after a few blinks? and another thinkg that im wondering, it's possible create a heightmap on godot using a mesh from blender?
    Keep the good work and good luck!

    • @garbaj
      @garbaj  4 роки тому +1

      I have a few other videos coming out before I make another tracer video, but ill keep those ideas in mind

    • @jamesxxxyz8775
      @jamesxxxyz8775 4 роки тому

      ua-cam.com/video/mLr8DtQ_Wbw/v-deo.html Recall

  • @Mikael5555
    @Mikael5555 2 роки тому

    Really good video, super easy to follow along with, one question, is there any way to add a cool down to it?

  • @jamesxxxyz8775
    @jamesxxxyz8775 4 роки тому +2

    I think it would be better with hyperspeed to a point, because of collison detection.

    • @garbaj
      @garbaj  4 роки тому

      Good point, I didn't even think about that

  • @kiloalpha1067
    @kiloalpha1067 2 роки тому

    Hey garbaj, I really like your videos man
    I just have a problem
    When I write "fall.y = jump" (without the quotation marks) , godot just shows an error and I can't seem to know why
    Could you please help me fix this?
    Thanks man

  • @anarchy3508
    @anarchy3508 3 роки тому +2

    How can you make it smooth

  • @DYNAMIC157
    @DYNAMIC157 4 роки тому +1

    Please make a video on a Spiderman character controller. I am talking about the grappling hook part.

    • @garbaj
      @garbaj  4 роки тому

      There's been a lot of requests for grappling hooks. I'll put it on the list

    • @DYNAMIC157
      @DYNAMIC157 4 роки тому

      Niceeee

  • @woah_tuhr
    @woah_tuhr 2 роки тому

    nice

  • @bnkm07
    @bnkm07 2 роки тому +2

    when I blink in front of a wall I can go trough it can u help me pls

    • @tzbq
      @tzbq 5 місяців тому

      uuhuhhh kinda late but on a characterbody you can call move_and_collide with your movement vector

    • @tzbq
      @tzbq 5 місяців тому

      instead of changing position

  • @PenguinGuy17
    @PenguinGuy17 6 місяців тому

    what if I dont want it to blink but more so woosh to it? like a dodge?

  • @rounak3811
    @rounak3811 3 роки тому +1

    Orange leggings not included😂😂😂

  • @mikatomik5532
    @mikatomik5532 2 роки тому

    Awesome. Now do the recall. 🤣🤣

  • @RGBA
    @RGBA 2 роки тому

    how can i use this on the updated fps movement?

  • @Boildroid
    @Boildroid 2 роки тому +1

    what about dishonored style blink?