FPS Touch Controls - UNITY 2021 Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 พ.ย. 2024

ความคิดเห็น • 148

  • @blackwarrior823
    @blackwarrior823 3 ปีที่แล้ว +20

    If you're getting error in old input system
    Try:
    Replace "=" with "==" in if statement.

    • @zacz7live445
      @zacz7live445 3 ปีที่แล้ว

      tnks'

    • @ani-gamer320
      @ani-gamer320 2 ปีที่แล้ว

      Yo thanks man 😂❤️

    • @stupidmemer08
      @stupidmemer08 2 ปีที่แล้ว +1

      i actually surfered for 1 hour thanks bro so much

    • @BLANK-eb5xv
      @BLANK-eb5xv 2 ปีที่แล้ว

      thankssss a lot hahaha that was helorious that i missed the detail

    • @alzayn3618
      @alzayn3618 2 ปีที่แล้ว

      I got another error and this error says "Assets\Scripts\Player\MouseLook.cs(37,62): error CS0104: 'TouchPhase' is an ambiguous reference between 'UnityEngine.InputSystem.TouchPhase' and 'UnityEngine.TouchPhase'

  • @uotsabchakma
    @uotsabchakma 2 ปีที่แล้ว +11

    I'm here just for the code for looking around. And this tut did helped me. Thanks for the code man!!!

    • @GDTitans
      @GDTitans  2 ปีที่แล้ว +4

      No problem 😊

  • @naimishrishu3255
    @naimishrishu3255 2 ปีที่แล้ว +3

    watching this in 2022 !! it helped me a lot bro thanks

    • @GDTitans
      @GDTitans  2 ปีที่แล้ว +1

      Glad to hear it!

  • @navinkumar7370
    @navinkumar7370 3 ปีที่แล้ว +7

    Can you make weapon drop and grab system? Plox?

  • @udaypankhaniya3042
    @udaypankhaniya3042 3 ปีที่แล้ว +17

    sir can you teach us how to add footstaps sound effect and jump sound to player. thank you for this amazing series

    • @InfiniteCodeSource
      @InfiniteCodeSource 2 ปีที่แล้ว +1

      I think you could do that with another tutorial and jsut like apply it

  • @xiaodongsong2359
    @xiaodongsong2359 2 ปีที่แล้ว +6

    I think there is something wrong with the logic of your MouseLook. What if I operate the left joystick first with the first finger, and then operate the camera rotation with the second finger?

    • @yogeshkadu5453
      @yogeshkadu5453 ปีที่แล้ว

      what if we iterate through each touch and store instance || TouchID of touch which is not interacting with UI,
      or use IPointerDown, Drag and UP event 😅 but its a bit complicated. 🥲

  • @matthews9298
    @matthews9298 2 ปีที่แล้ว +5

    When I touch the joystick to move screen back and forth it also causes the camera to rotate. Why?

  • @a.b.g9755
    @a.b.g9755 3 ปีที่แล้ว +4

    Next tutorials on more hyper causal games like voodoo games for beginners...

  • @woozworldasinaka9725
    @woozworldasinaka9725 2 ปีที่แล้ว +3

    In (EventSystem.current.IsPointerOverGameObject(Touchscreen.current.touches[0].touchId.ReadValue()))
    Can we have an exception? When I'm on aim mode I still wanna move my screen while keeping the button pressed.

  • @inteligenciafutura
    @inteligenciafutura 3 ปีที่แล้ว +2

    It didn't help me at all, but it did guide me, good video.

    • @GDTitans
      @GDTitans  3 ปีที่แล้ว +1

      I will upload another video that explains an easier way using the new input system 😀

  • @Heimdall12345
    @Heimdall12345 3 ปีที่แล้ว +2

    Hi bro
    Can you make another video about
    How to make reaload button
    Zoom in/out and gun change buttons?

  • @1onGoogle
    @1onGoogle 7 หลายเดือนก่อน

    Hi, You don't need to create apk file to test touch screen rather you can test it from Simulator on editor..

  • @drskillful3461
    @drskillful3461 2 ปีที่แล้ว +4

    Hey bro, amazing vid! Though, I have an error. It says: "The name 'Touchscreen' does not exist in the current context". How do i fix that?

    • @GDTitans
      @GDTitans  2 ปีที่แล้ว +2

      Thanks for your comment
      Make sure to install the new input system package and restart unity
      And include the package
      using UnityEngine.InputSystem

    • @drskillful3461
      @drskillful3461 2 ปีที่แล้ว +2

      @@GDTitans I figured it out myself, I was using the old input system! Btw your code for the old input has an error! It's actually 2 ==!

    • @DARK_AMBIGUOUS
      @DARK_AMBIGUOUS ปีที่แล้ว +1

      That means the object with that name is not found, the object has a different name

    • @drskillful3461
      @drskillful3461 ปีที่แล้ว

      @@DARK_AMBIGUOUS thanks for the reply, but I already solved my problem!

  • @k-6353
    @k-6353 ปีที่แล้ว +1

    Hi, wonderful video, I have been trying to find solutions for three continuous days, this one is the best so far. But might you know how to be able to select which UI blocks the touch? I have UI's in worldspace and when i swipe across it, the camera control will stop/will not rotate. I have been trying for several hours and still have no working script to modify it. If anyone can help, it will be great!

  • @xflash2581
    @xflash2581 2 ปีที่แล้ว +2

    love your explaining style 😶‍🌫😉😉

    • @GDTitans
      @GDTitans  2 ปีที่แล้ว +2

      Glad to hear that.

  • @gamedevelopmentwithunity2050
    @gamedevelopmentwithunity2050 2 ปีที่แล้ว +1

    Sir you are god literally I learned too much about touch controls thanku 🤩🤩💖

  • @icjhonny9390
    @icjhonny9390 3 ปีที่แล้ว +3

    Het plzz make a all button event trigger plz I can't understand to set like scope button , help us

    • @GDTitans
      @GDTitans  3 ปีที่แล้ว +2

      Actually there is an easier way by using the new input system.
      I am gonna upload a video to demonstrate that.
      So, make sure to follow my 2d platformer series 😀

    • @icjhonny9390
      @icjhonny9390 3 ปีที่แล้ว +2

      @@GDTitans ok thnx bro

  • @luck4042
    @luck4042 2 ปีที่แล้ว +3

    Hi, i have this error when i use the bool isShooting = CrossPlatformInputManager.GetButton("Shoot");
    The erros is:InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
    UnityStandardAssets.CrossPlatformInput.PlatformSpecific.StandaloneInput.GetButton

  • @jsrmalert9897
    @jsrmalert9897 ปีที่แล้ว +2

    I have an error : NullReferenceException: Object reference not set to an instance of an object
    MouseLook.Update () (at Assets/MouseLook.cs:15)
    How can i solve that ?

    • @GDTitans
      @GDTitans  ปีที่แล้ว +1

      th-cam.com/video/OFXvvuxqPNQ/w-d-xo.html

  • @sakuraharuno8046
    @sakuraharuno8046 3 ปีที่แล้ว +2

    Please make a tutorial on weapon and ammo pickup and drop system

    • @DARK_AMBIGUOUS
      @DARK_AMBIGUOUS ปีที่แล้ว

      Just make the objects have a collider and set it to "Trigger" and then make it so On Trigger Enter, the object gets added to your inventory or spears in your hand, or however your game works, I can't really explain it because every game works differently, then make it so lastly, the object is destroyed

  • @DSCJIRA
    @DSCJIRA 3 ปีที่แล้ว +2

    Hi. I'm following your video whose name is "FPS Touch Controls. I followed this video. And i builded and played. But the gun's effect is continuing play and jump button is not working. How can I fix it? Plz help me.

  • @darkrai6392
    @darkrai6392 3 ปีที่แล้ว +2

    Subscribed! Waiting for more android game tutorial!

  • @pufffact
    @pufffact ปีที่แล้ว +1

    I import your files in unity 2022 so face so many error in console 😢😢

  • @xermi00
    @xermi00 2 ปีที่แล้ว +2

    Hi, I am having a problem with the controls. When I slide the joystick with my finger too high or too low the player looks in that direction. That shouldn't be happening when I use the joystick. Do you have any idea how can I fix that?

  • @iyadhatem6955
    @iyadhatem6955 ปีที่แล้ว +3

    You are Boss Man, Thank you.

    • @GDTitans
      @GDTitans  ปีที่แล้ว +1

      You're welcome!

  • @afrozkhan2094
    @afrozkhan2094 ปีที่แล้ว +1

    Nice Tutorial!

  • @DarkMooN-uh1ih
    @DarkMooN-uh1ih ปีที่แล้ว +2

    Thank's a lot GDTitans i learned a lot of things

    • @GDTitans
      @GDTitans  ปีที่แล้ว +1

      I'm glad to hear that!

  • @vextorfx6243
    @vextorfx6243 2 ปีที่แล้ว +1

    i just want to know where did u put MouseLock file in canvas ? that connected with Image? or with camera?

    • @jsrmalert9897
      @jsrmalert9897 ปีที่แล้ว

      i wanna know that too, do you know where ?

    • @pritalol-sc2or
      @pritalol-sc2or 9 หลายเดือนก่อน

      me too

  • @DivaGameDeveloper
    @DivaGameDeveloper 3 ปีที่แล้ว +2

    Iam unable to use TouchScreen can u please help me to how to use that keyword..

  • @udayprajapati4459
    @udayprajapati4459 3 ปีที่แล้ว +2

    Plz create video on game objective

  • @hmksoft-organization3792
    @hmksoft-organization3792 2 ปีที่แล้ว +3

    the old input system code you give are showing error 9:59

  • @djkorou
    @djkorou 3 ปีที่แล้ว +2

    hey, this would have helped but can you please put the first person movement script? along with the mouse look

    • @GDTitans
      @GDTitans  3 ปีที่แล้ว +1

      Check out the project on my github account github.com/Chaker-Gamra/FPS-Game-Unity

  • @sanghoonlim6505
    @sanghoonlim6505 2 ปีที่แล้ว +1

    Can I ask you to subtitle?
    Because I can't use auto translation, and I want to read subtitles.

  • @martinthilak6573
    @martinthilak6573 3 ปีที่แล้ว +2

    Really helpful, thanks for the tutorial.what about the sniper scope button.if possible teach us.

    • @GDTitans
      @GDTitans  3 ปีที่แล้ว +1

      It's easy try to use what you know to implement it.

    • @martinthilak6573
      @martinthilak6573 3 ปีที่แล้ว +1

      Okay I will try thank you.

    • @DARK_AMBIGUOUS
      @DARK_AMBIGUOUS ปีที่แล้ว

      It's 100% possible, just make a button that plays an animation of the camera zooming in, then make one of it zooming out

  • @fachri17
    @fachri17 2 ปีที่แล้ว +2

    Sir thankyou so much, it help me a lot sir

  • @ashazaliazhar8058
    @ashazaliazhar8058 3 ปีที่แล้ว +3

    Assalam alaikum nice video

    • @GDTitans
      @GDTitans  3 ปีที่แล้ว +2

      Walaikum assalam,
      Thanks

  • @Stinger-rq4gy
    @Stinger-rq4gy 2 ปีที่แล้ว +2

    thank you for making these videos

    • @GDTitans
      @GDTitans  2 ปีที่แล้ว +1

      No problem 😊

    • @jawadsabih4979
      @jawadsabih4979 2 ปีที่แล้ว

      @@GDTitans assalamu alaikum can you plz help because the last thing u did didnt work i am still getting the bug where both joystick and touchfield move

  • @creativetechlmchannel7779
    @creativetechlmchannel7779 2 ปีที่แล้ว +1

    sir what programming are you using?

  • @Radspidey
    @Radspidey ปีที่แล้ว +2

    Does anybody know how to decrease the touch sensitivity @GDTitans

    • @DARK_AMBIGUOUS
      @DARK_AMBIGUOUS ปีที่แล้ว +2

      Yes but I don't know how to code, I use the visual scripting so I just use the math units and I divide the number before it's connected to "Set Position"

  • @lucasradioativo
    @lucasradioativo ปีที่แล้ว

    make Third Person Controlle please

  • @thaergamer5828
    @thaergamer5828 3 ปีที่แล้ว +1

    make a tutorial about survival game

  • @d1kiywolf
    @d1kiywolf 2 ปีที่แล้ว +1

    hi, i have an error on cs:22 "object reference not set to an instance of an object" (11:08)

    • @lolip_p
      @lolip_p ปีที่แล้ว

      please tell me, did you solve this problem?
      if yes, please tell me how to fix it

    • @d1kiywolf
      @d1kiywolf ปีที่แล้ว

      @@lolip_p i don't remember. better use another tutorial

  • @hrithikroshansingh3006
    @hrithikroshansingh3006 2 ปีที่แล้ว +1

    sir in Joystick pack fixed joystick script is missing

  • @ani-gamer320
    @ani-gamer320 2 ปีที่แล้ว +1

    It's not working if i press joystick after that if i tried to move player then it's not working? Can you tell some fix

    • @GDTitans
      @GDTitans  2 ปีที่แล้ว +2

      Check out the script on Github github.com/Chaker-Gamra/FPS-Game-Unity

    • @ani-gamer320
      @ani-gamer320 2 ปีที่แล้ว

      @@GDTitans thnx ❤️

  • @ani-gamer320
    @ani-gamer320 2 ปีที่แล้ว +1

    I'm facing one problem it work awesome but when joystick is pressed then I can't rotate my player?

    • @GDTitans
      @GDTitans  2 ปีที่แล้ว +2

      github.com/Chaker-Gamra/FPS-Game-Unity/blob/master/Assets/Scripts/Player/MouseLook.cs

    • @ani-gamer320
      @ani-gamer320 2 ปีที่แล้ว

      @@GDTitans Thanks ❤️

    • @Heimdall12345
      @Heimdall12345 2 ปีที่แล้ว

      Bro did you fix it?
      I have the same probem

  • @ishowsneaky
    @ishowsneaky 3 หลายเดือนก่อน +1

    Is it free to use, thank

  • @videoclipschannel100
    @videoclipschannel100 3 ปีที่แล้ว +4

    Hi, thanks for this nice tutorial, I am using the old input system and uses joystick controls and implemented codes given in the video, when I build my game on android uses a joystick for moving the screen will movies because it counts the touches on the joystick as well, how can I use this joystick only for moving the character and not for moving the camera. I am using the MouseLook script.

    • @DebugL-s2s
      @DebugL-s2s 10 หลายเดือนก่อน

      Hello, has this issue been resolved

  • @WaffleTM420
    @WaffleTM420 3 ปีที่แล้ว

    Damn that is really helpful for my iOS game

  • @underratedtheboi7595
    @underratedtheboi7595 2 ปีที่แล้ว +1

    Will it work on rigid body?

  • @dahdousoufyane3795
    @dahdousoufyane3795 ปีที่แล้ว +1

    NullReferenceException: Object reference not set to an instance of an object
    MouseLook.Update () (at Assets/Scripts/Player/MouseLook.cs:39)
    Pleas help me

    • @GDTitans
      @GDTitans  ปีที่แล้ว +1

      th-cam.com/video/OFXvvuxqPNQ/w-d-xo.html

  • @saramotamaralayefaemmanuel9772
    @saramotamaralayefaemmanuel9772 2 ปีที่แล้ว +1

    Starter assets is no longer available

  • @techhack5775
    @techhack5775 3 ปีที่แล้ว +2

    Thanks bro

    • @GDTitans
      @GDTitans  3 ปีที่แล้ว

      You are welcome

  • @learntech3323
    @learntech3323 2 ปีที่แล้ว +1

    can someone please give me the crossplatforminput and editor folder without the other useless files
    thanks

  • @jsrmalert9897
    @jsrmalert9897 ปีที่แล้ว +2

    Where can i put the MouseLook script? I cant undersatnd, where did u put?

  • @a.technology1446
    @a.technology1446 3 ปีที่แล้ว +1

    Thanks a lot

  • @mostafayasser5645
    @mostafayasser5645 3 ปีที่แล้ว

    could you please teach us how to make tournaments in unity in which you could face random rivals and if you qualified you face the other qualified rivals till reaching the final and the you are the champion

    • @DARK_AMBIGUOUS
      @DARK_AMBIGUOUS ปีที่แล้ว

      I guess you would use Mirror Networking or one of the other multiplayer things

  • @stupidmemer08
    @stupidmemer08 2 ปีที่แล้ว

    hello sir i have error that on old input it says you cannot use "&&" between bool and float type
    please help me

    • @fachri17
      @fachri17 2 ปีที่แล้ว

      Use == instead of = sir

    • @alzayn3618
      @alzayn3618 2 ปีที่แล้ว

      @@fachri17 Thanks but I got another error and this error says "Assets\Scripts\Player\MouseLook.cs(37,62): error CS0104: 'TouchPhase' is an ambiguous reference between 'UnityEngine.InputSystem.TouchPhase' and 'UnityEngine.TouchPhase'

    • @xermi00
      @xermi00 2 ปีที่แล้ว

      @@fachri17 tysm, I fixed it

  • @eyadaboelazm9057
    @eyadaboelazm9057 2 หลายเดือนก่อน +1

    i have this error ( } expected ) any one can fix

  • @akhil_j14
    @akhil_j14 2 ปีที่แล้ว +1

    How to add grandes in this game

    • @GDTitans
      @GDTitans  2 ปีที่แล้ว +1

      th-cam.com/video/BYL6JtUdEY0/w-d-xo.html

  • @abufaiz3896
    @abufaiz3896 ปีที่แล้ว +1

    Despite adding
    If(eventsystem.current.ispointerOverGameObject(touchscreen.current.tousches[0].touchid.ReadValue())return;
    My joystick still moves the camera

  • @josuegaming2965
    @josuegaming2965 3 ปีที่แล้ว +1

    I have 15 problems with the system input

  • @akhil_j14
    @akhil_j14 2 ปีที่แล้ว +1

    How to add levels in this game

    • @GDTitans
      @GDTitans  2 ปีที่แล้ว

      th-cam.com/video/S5eo5cFk51U/w-d-xo.html

  • @jud.su.5developer895
    @jud.su.5developer895 2 ปีที่แล้ว

    How can shoot and aim on one button

  • @blokkiesotto5854
    @blokkiesotto5854 2 ปีที่แล้ว

    pls help cuz my joystick doesnt work

  • @CreateCG1
    @CreateCG1 ปีที่แล้ว +1

    I want hidden controls

    • @GDTitans
      @GDTitans  ปีที่แล้ว +1

      I've talked about that in this video
      th-cam.com/video/wdsLDogAALI/w-d-xo.html

    • @CreateCG1
      @CreateCG1 ปีที่แล้ว

      @@GDTitans no like a cross play game for mobile & pc

    • @CreateCG1
      @CreateCG1 ปีที่แล้ว

      @@GDTitans i need help with my fps game

  • @nakendamacesarezate1797
    @nakendamacesarezate1797 2 ปีที่แล้ว +3

    where the button handler script???

  • @stupidmemer08
    @stupidmemer08 2 ปีที่แล้ว

    best sir
    ;>

  • @yusufum_
    @yusufum_ ปีที่แล้ว +1

    great

    • @GDTitans
      @GDTitans  ปีที่แล้ว +1

      Thanks 😊
      th-cam.com/video/NDDXip3ex94/w-d-xo.html

  • @PPSSPP0002
    @PPSSPP0002 ปีที่แล้ว +1

    Gradle build failed

    • @PPSSPP0002
      @PPSSPP0002 ปีที่แล้ว +1

      How to solve

    • @GDTitans
      @GDTitans  ปีที่แล้ว +2

      For the first time, it needs internet access

    • @PPSSPP0002
      @PPSSPP0002 ปีที่แล้ว +1

      @@GDTitans yes and after

  • @Horrible10
    @Horrible10 ปีที่แล้ว +1

    whay dont work

    • @GDTitans
      @GDTitans  ปีที่แล้ว +1

      This is the new way that works with the new input system
      th-cam.com/video/wdsLDogAALI/w-d-xo.html

  • @Gamer-bg8bk
    @Gamer-bg8bk 3 ปีที่แล้ว +2

    can anyone help? :)

    • @GDTitans
      @GDTitans  3 ปีที่แล้ว

      Hey what's up

  • @startandplay688
    @startandplay688 3 ปีที่แล้ว +2

    hey please make fast video because
    i want to publish my game on play store..,
    (how to proper build a game for play store ??)..,
    please given details for update password, key, intro, google ads bundle ??

  • @unkownLife.is0
    @unkownLife.is0 หลายเดือนก่อน

    bro thz 😂

  • @lucasramos001
    @lucasramos001 ปีที่แล้ว +1

    Sensacional 👏

    • @erickhjc
      @erickhjc ปีที่แล้ว

      E mano samos unicos br aqui aprendendo kkk

  • @666-d5y
    @666-d5y 2 ปีที่แล้ว +1

    Lojitik

  • @navinkumar7370
    @navinkumar7370 3 ปีที่แล้ว

    Thonks

  • @designer.trifonov
    @designer.trifonov ปีที่แล้ว

    сложно

  • @Gamer-bg8bk
    @Gamer-bg8bk 3 ปีที่แล้ว

    Hello! I get these error messages: I press the jump button but I immediately receive these sentences:
    InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
    UnityStandardAssets.CrossPlatformInput.PlatformSpecific.StandaloneInput.GetButtonDown (System.String name) (at Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/StandaloneInput.cs:22)
    UnityStandardAssets.CrossPlatformInput.CrossPlatformInputManager.GetButtonDown (System.String name) (at Assets/Standard Assets/CrossPlatformInput/Scripts/CrossPlatformInputManager.cs:121)
    PlayerMovement.Update () (at Assets/Scripts/PlayerMovement.cs:66)

    • @jawadsabih4979
      @jawadsabih4979 2 ปีที่แล้ว

      u are using old input system