FPS Touch Controls - UNITY 2021 Tutorial

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

КОМЕНТАРІ • 148

  • @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!!!

  • @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'

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

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

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

      Glad to hear it!

  • @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 😀

  • @navinkumar7370
    @navinkumar7370 3 роки тому +7

    Can you make weapon drop and grab system? Plox?

  • @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. 🥲

  • @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..

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

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

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

    love your explaining style 😶‍🌫😉😉

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

      Glad to hear that.

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

    You are Boss Man, Thank you.

  • @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.

  • @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

  • @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.

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

    Subscribed! Waiting for more android game tutorial!

  • @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

  • @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!

  • @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!

  • @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...

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

    Nice Tutorial!

  • @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!

  • @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

      ua-cam.com/video/OFXvvuxqPNQ/v-deo.html

  • @ashazaliazhar8058
    @ashazaliazhar8058 3 роки тому +3

    Assalam alaikum nice video

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

      Walaikum assalam,
      Thanks

  • @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?

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

    Sir thankyou so much, it help me a lot sir

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

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

  • @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

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

    Will it work on rigid body?

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

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

  • @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.

  • @hmksoft-organization3792
    @hmksoft-organization3792 2 роки тому +3

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

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

    sir what programming are you using?

  • @WaffleTM420
    @WaffleTM420 3 роки тому

    Damn that is really helpful for my iOS game

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

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

  • @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

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

    sir in Joystick pack fixed joystick script is missing

  • @ishowsneaky
    @ishowsneaky 3 місяці тому +1

    Is it free to use, thank

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

    Starter assets is no longer available

  • @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

  • @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 ❤️

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

    Thanks bro

  • @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

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

    Plz create video on game objective

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

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

  • @a.technology1446
    @a.technology1446 3 роки тому +1

    Thanks a lot

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

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

  • @eyadaboelazm9057
    @eyadaboelazm9057 2 місяці тому +1

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

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

    make Third Person Controlle please

  • @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

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

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

  • @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"

  • @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

  • @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

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

    make a tutorial about survival game

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

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

  • @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

  • @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

  • @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

      ua-cam.com/video/OFXvvuxqPNQ/v-deo.html

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

    How to add grandes in this game

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

      ua-cam.com/video/BYL6JtUdEY0/v-deo.html

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

    great

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

      Thanks 😊
      ua-cam.com/video/NDDXip3ex94/v-deo.html

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

    I have 15 problems with the system input

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

    where the button handler script???

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

    best sir
    ;>

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

    How to add levels in this game

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

      ua-cam.com/video/S5eo5cFk51U/v-deo.html

  • @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

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

    Sensacional 👏

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

      E mano samos unicos br aqui aprendendo kkk

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

    I want hidden controls

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

      I've talked about that in this video
      ua-cam.com/video/wdsLDogAALI/v-deo.html

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

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

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

      @@GDTitans i need help with my fps game

  • @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
      ua-cam.com/video/wdsLDogAALI/v-deo.html

  • @Gamer-bg8bk
    @Gamer-bg8bk 3 роки тому +2

    can anyone help? :)

  • @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 ??

  • @navinkumar7370
    @navinkumar7370 3 роки тому

    Thonks

  • @unkownLife.is0
    @unkownLife.is0 Місяць тому

    bro thz 😂

  • @666-d5y
    @666-d5y 2 роки тому +1

    Lojitik

  • @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)