How To Make Aim Down Sight in 3 MINUTES (Aiming) | Unity 3D

Поділитися
Вставка
  • Опубліковано 16 лют 2022
  • Scripts: github.com/Noblob/Aiming.git
    This shows you how to aim down sights when right click is being held in unity 3d
    Music: Fresh Start - Joakim Karud

КОМЕНТАРІ • 62

  • @_jexool_GD_
    @_jexool_GD_ 6 місяців тому +3

    Thank You So Much! I'm Currently Making A Multiplayer FPS Shooter Game In Unity Every And Every Other Tutorial Didn't Work I Thought This One Didn't Work Too, But Then I Realized My Animation For Aiming Down Sights Was Called ADS Not Aim And I'm Very Glad It Works!

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

    honestly this channel is a dream come true for me if had difficulty finding a good aiming tutorial and this one perfected it and it was easy enough for me to copy it! you have earnt yourself a new subscriber!

  • @SLBodyBuilding
    @SLBodyBuilding Рік тому +4

    Thank you so much for this tutorial it helped a lot!

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

    Thanks so much for wonderful tutorial simple and effective

  • @lebbyash
    @lebbyash Рік тому +2

    Thank you very much. It helped. :)

  • @codmhumanoid9271
    @codmhumanoid9271 Рік тому +3

    When i right click, The gun goes all the way right and it keeps going right until i right click. Like wtf. Please help me

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

    Thanks

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

    Nice video

  • @jhonthedishwasher6439
    @jhonthedishwasher6439 Рік тому +1

    why does my firing animation stops playing when i aim down and fires?

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

    When I press M2 it doesnt do anything, it just loads the new state animation over and over without moving my gun

  • @user-bl9kq4ht6b
    @user-bl9kq4ht6b 27 днів тому

    I mean looks promising

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

    Good video. It works! Any idea how to get a firing animation to work while ADS?

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

      Thanks! I have a video uploaded on how to do ADS and in pretty sure this should work with it already on!

  • @parthbohra2399
    @parthbohra2399 8 місяців тому +1

    in a third person shooter game how to make it switch from third person to iron sight ??

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

      you also need to code an animation to move the camera to the first person under downkey 1 and on upkey 1 new state

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

    tysm bro !!!!

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

    I can ADS fine but while holding down right mouse button the gun slowly drifts to another position

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

      this happens because your animation frames on the 60 arent correctly set so instead of copying both frames to 60 just copy the second then paste that to 60 so it wouldnt slowly drift to the first anymore

  • @RealWorld125
    @RealWorld125 Рік тому +2

    when i look around the gun stays on the x axix and dosnt rotate with the camera please help

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

      Is your camera the parent object of your gun?

    • @RealWorld125
      @RealWorld125 Рік тому +1

      @@NoblobRS no does it need to be ?

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

      @@NoblobRS i fixed it lol, it was because the gun wasnt parented to my camera lmao. ty

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

    I always get the Error: NullReferenceException: Object reference not set to an instance of an object. I really don't know hot to fix that, I hope that you can help with my problem

    • @oGurk
      @oGurk Рік тому +1

      Did you find a fix for this. If so could you tell me what the problem was.

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

      @@oGurk unfortunatly not

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

      Make sure the name in line 5 (public class Aim : MonoBehaviour)is the same name you gave the script

  • @Poncki
    @Poncki 11 місяців тому

    Hi how do i make it zoom out smoothly too instead of snapping back

    • @knownmystic
      @knownmystic 9 місяців тому

      Just put the keyframes later. For example instead of 0:10 put 0:25.

  • @Mkbfnf
    @Mkbfnf 11 місяців тому

    i tried that and error in the consle :
    Animator.GotoState: State could not be found
    UnityEngine.Animator:Play (string)

    • @knownmystic
      @knownmystic 9 місяців тому +1

      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      public class Aim : MonoBehaviour
      {
      public GameObject Gun;
      // Update is called once per frame
      void Update()
      {
      aimDownSight();
      }
      void aimDownSight()
      {
      if (Input.GetButtonDown("Fire2"))
      {
      Gun.GetComponent().Play("aimDownSights");
      }
      if (Input.GetMouseButtonUp(1))
      {
      Gun.GetComponent().Play("New State");
      }
      }
      }
      Here you go, all you need to do is change input method to get button down and set it to fire2. Make sure it's setup in project settings. (it is by default)

  • @rblxl3g3nd66
    @rblxl3g3nd66 Рік тому +1

    Hi! When I do this, the animation just keeps repeating. Is there a way to stop this?

    • @estroyer9
      @estroyer9 Рік тому +2

      You have to go to your animations folder, click your aim animation, and uncheck looping in the inspector. I'm sure you've figured it out but I hope it helps someone.

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

      @@estroyer9 Thanks for the tip!

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

    How can I make it more smooth?

    • @knownmystic
      @knownmystic 9 місяців тому

      Just put the keyframes later. For example instead of 0:10 put 0:25.

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

    it doesn't work when i fire my gun. what do i do?

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

      What's your fire key? :)

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

      Blend trees maybe? you could also make your own fire animation for aiming down sights which I would do.

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

      add procedural recoil

  • @zombanatoryeet1565
    @zombanatoryeet1565 10 місяців тому

    it says invalid index layer -1 pls respond with a fix

    • @knownmystic
      @knownmystic 9 місяців тому

      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      public class Aim : MonoBehaviour
      {
      public GameObject Gun;
      // Update is called once per frame
      void Update()
      {
      aimDownSight();
      }
      void aimDownSight()
      {
      if (Input.GetButtonDown("Fire2"))
      {
      Gun.GetComponent().Play("aimDownSights");
      }
      if (Input.GetMouseButtonUp(1))
      {
      Gun.GetComponent().Play("New State");
      }
      }
      }
      Here you go, all you need to do is change input method to get button down and set it to fire2. Make sure it's setup in project settings. (it is by default)

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

    I have an error that says invalid layer index -1 please help

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

      same

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

      @@lungomungo look through everything and make sure it all matches, i fixed it and it was easy i just dont remember how

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

      @@glowy6289 did u have any other animations like idle or reloading? and did u follow the exact steps in the tutorial? cuz mine still didnt work

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

      @@lungomungo nope, and i did follow the exact tutorial

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

    Is not do anything 😞😭

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

    its not working for me can you help me ?

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

      Sure! What part of it isn't working? Are there any errors or is it just not working?

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

      @@NoblobRS When i press the mouse button it not zooming

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

      the most likely thing is that the name of the animation doesnt match the call to it in the script. if you named it the same as mine, check if the script is attached to your player? is the gun in the slot? and have you made the animation?

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

      @@NoblobRS i tried to put it on my gun and my weapon holder i didnt try player

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

      Okay well make sure put everything in their slots. Also, it shouldn't matter whether its attached to your player or gun but its always worth a try!

  • @watc..1
    @watc..1 2 роки тому

    something doesnt work :(

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

      Do you know what exactly isn't working? any errors? is the whole thing just not working?

    • @watc..1
      @watc..1 2 роки тому

      @@NoblobRS it has and error that reads "invalid layer index '-1'" idk what im doing wrong

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

      @@NoblobRS Im having the same issue please respond with a fix

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

    didnt work :(