Detect Clicks in Unity 2D (New Input System) | Bite-Sized Tutorials

  Рет қаралды 31,313

chonk

chonk

Күн бұрын

Пікірлер: 57
@Vexcenot
@Vexcenot 9 ай бұрын
0:25 scroll down and and find something specifically called input actions. The way he edited it makes it look like he clicked on player mask. Dont.
@MrLuckyLISS
@MrLuckyLISS 8 ай бұрын
Thx, man
@uw6de
@uw6de 6 ай бұрын
Yes, it took me a while to figure out what the fuck he did there.
@WalacaVencano
@WalacaVencano 15 күн бұрын
OMG thank you so much otherwise I would be hardstuck.
@tegxi
@tegxi 11 ай бұрын
Love how concise this tutorial is! Much better to lean too fast than too slow, as pausing will likely be needed either way and it's better for the information to be presented quicker.
@chonkgames
@chonkgames 11 ай бұрын
I'm very glad you liked it! 🤗
@TechBoxNorth
@TechBoxNorth Жыл бұрын
All this just to tell a 2d object that I'm clicking on it!? omg! Video was to the point and easy to follow, thanks for sharing!
@Pentaxant
@Pentaxant 11 ай бұрын
when clicking once, tell the input system to wait for half a second or so, if there has been another click on that half second, count it as a double click
@Axwitech
@Axwitech Жыл бұрын
Great, short and informative video. Please make more. I'd like a similar style video regarding Unitys UI system and how to make simple UI elements.
@turtlecabaret
@turtlecabaret 10 ай бұрын
this is my fav tutorial yet tysm! how do you achieve the 'bouncing' effect on click that you display at the end of the video? I want when an object is clicked on in my scene for the colour of it to change, I'm wondering if it's best to replace the sprite image with a differently coloured sprite image or if that can be done within Unity on the original image? tysm!!
@Weeniehutnurse
@Weeniehutnurse Жыл бұрын
This helped me out so much, and was a lot easier than the code I was making for clicking objects. Now I'm going to do a drag and drop with it.
@jonathangarciarodriguez1240
@jonathangarciarodriguez1240 10 ай бұрын
This is really nice. Do you think you can do a touchscreen variant on 3d?
@bumbljumbl4481
@bumbljumbl4481 2 ай бұрын
0:25 If you just installed the input system make sure to restart Unity otherwise you won't get the input actions button when trying to create it
@chonkgames
@chonkgames Ай бұрын
Great tip for everyone!
@Ugeen-Huge-Jeans
@Ugeen-Huge-Jeans 10 ай бұрын
So there is no way to use the old OnMouse - events with the new input system anymore? Or something similar?
@alexpompon382
@alexpompon382 Жыл бұрын
in the "Player input" component in "Events/Gameplay/Click(CallbackContext)" it doesnt show up the "On click" funtion. However it shows "No function" and Mono script
@MoonRabbit_EN
@MoonRabbit_EN Жыл бұрын
It just happened to me too. You missed the part where InputHandler script needs to be attached to InputHandler game object (1:06) and then in the Player Input component you need to assign your game object's Input Handler component, not the script. Whenever you see "No function" and Mono script, you know you assigned the script itself instead of a component.
@MagicCubeWorld
@MagicCubeWorld Ай бұрын
For me this happened because I forgot a semicolon in my InputHandler script. Fixed it, saved, it's there now.
@lonk199
@lonk199 Жыл бұрын
I'm getting this error: NullReferenceException: Object reference not set to an instance of an object when I double click it it goes to the line where I create the variable rayHit
@Sukhmnn_Preet
@Sukhmnn_Preet 9 ай бұрын
Did you find a fix
@ALFaer-l5p
@ALFaer-l5p 3 ай бұрын
@@Sukhmnn_Preet Do Camera "public" and add your Camera object there. It will fix this problem.
@mendo1522
@mendo1522 Жыл бұрын
I LOVE YOU. Such a good, short video that gets you up and running.
@chonkgames
@chonkgames Жыл бұрын
Aww, thank you! 🤗
@Coltingtons
@Coltingtons 9 ай бұрын
0:24 what did he click on in the create menu I can't see even on .25 speed
@sancho8237
@sancho8237 9 ай бұрын
It's called "Input Actions" it's at the very bottom of the list, you might have to cliick a little downwards arrow in order for it to appear
@srishtijitpure9082
@srishtijitpure9082 9 ай бұрын
​@@sancho8237 I don't find it
@tilum8342
@tilum8342 6 ай бұрын
@@srishtijitpure9082 Restart Unity
@tahmidtarique6077
@tahmidtarique6077 2 ай бұрын
@@srishtijitpure9082 Same. Did you find it?
@halinek7713
@halinek7713 11 ай бұрын
Nice tutorial! But how to change it to work with holding mosue button, not only clicking once?
@Alex-e-Azam
@Alex-e-Azam Жыл бұрын
getting this error: error CS0234: The type or namespace name 'Remoting' does not exist in the namespace 'System.Runtime' (are you missing an assembly reference?)
@jethrolemons124
@jethrolemons124 6 ай бұрын
I am new and really would like if this is easier because when i try to find a "touching mouse?" vid i can't find one so please make a simple video for beginners
@DexterCrappell
@DexterCrappell 11 ай бұрын
The code didn't work for me. it is full of errors but i did exactly what you said.
@MightyBlow
@MightyBlow 11 ай бұрын
can this be used to create an anti-auto-clicker?
@kabukidanshi7874
@kabukidanshi7874 Жыл бұрын
Thank you so much! It worked on the first try 😁
@chonkgames
@chonkgames Жыл бұрын
I'm very glad to hear that! Thank you!
@OwenLake-zw4bn
@OwenLake-zw4bn Жыл бұрын
how would you modify the code to work for touch inputs
@Talonos2
@Talonos2 5 ай бұрын
Yeah, he hard-coded the input handler to look at the mouses position. You can add a binding to the "Click" function to make it so that a touch input can fire the event... but then the event looks at where the mouse is, not where the event took place, so if you don't have a mouse, it wont work right. :/
@shadow_lev-9652
@shadow_lev-9652 Жыл бұрын
it doesnt work, it just doesn't hit the collider (it IS set on the gameObject)
@noisyminer
@noisyminer Жыл бұрын
Check "Active Input Handling" in player settings and make sure it is set to new input system
@shadow_lev-9652
@shadow_lev-9652 Жыл бұрын
@@noisyminer i fixed it by just changing the rendering layer of the background (I saw that, when I applied a sprite to my invisible collider)
@ElysianAura
@ElysianAura 10 ай бұрын
@@noisyminer Holy shit thank you. I was bashing my head on why this project wasn't working at all when I had just used the new input system on my last 2 projects. Was still stuck on the old system there for some god forsaken reason.
@IKK8888
@IKK8888 Жыл бұрын
very helpful! Thank you!
@renisrrenis9225
@renisrrenis9225 Жыл бұрын
is it most efficient way to detect clicks on large amount of objects?
@cecisharp
@cecisharp 6 ай бұрын
Amazing tutorial, thanks!
@chonkgames
@chonkgames 6 ай бұрын
Thank you for the kind words! 🤗
@HaikAgdere
@HaikAgdere 3 ай бұрын
All of this just to detect a click?
@boltsy6525
@boltsy6525 3 ай бұрын
thats what im saying lol its ridiculous
@advancedgp530
@advancedgp530 9 ай бұрын
bro this guy is everywhere at the same time LOL, mans mouse is teleporting and the frames cant keep up with him
@InvisibleMan020
@InvisibleMan020 Жыл бұрын
you're a life saver, thank u so mutch.
@hermionegreen333
@hermionegreen333 9 ай бұрын
so useful thank you!
@BoplBattleBros
@BoplBattleBros Жыл бұрын
Är du från sverige
@chonkgames
@chonkgames Жыл бұрын
Stämmer mycket bra, det!
@jedimangia
@jedimangia 2 ай бұрын
super!
@guru_laghima
@guru_laghima Жыл бұрын
Thank you very much
@appsforkids7808
@appsforkids7808 3 ай бұрын
нічого незрозуміло
@dooshimagames
@dooshimagames Жыл бұрын
Thanks so much
Drag & Move a Camera in Unity 2D | Bite-Sized Tutorials
4:35
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
The Trick I Used to Make Combat Fun! | Devlog
8:12
Game Endeavor
Рет қаралды 1,7 МЛН
The Power of Scriptable Objects as Middle-Men
17:41
samyam
Рет қаралды 131 М.
Unity - Detect Button Name on Click
2:07
Tofaani
Рет қаралды 10 М.
My Favorite way to Click on GameObjects
4:51
VR with Andrew
Рет қаралды 50 М.
Cooldown in Unity | Bite-Sized Tutorials
2:58
chonk
Рет қаралды 10 М.
How to use Unity's New INPUT System EASILY
9:32
BMo
Рет қаралды 244 М.
Drag and drop in Unity UI - create your own inventory UI!
12:47
Coco Code
Рет қаралды 117 М.
Custom Cursors In Unity
3:52
bendux
Рет қаралды 48 М.
2D PATHFINDING - Enemy AI in Unity
23:13
Brackeys
Рет қаралды 828 М.
How to make 2D GLOW in Unity!
15:56
Brackeys
Рет қаралды 609 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН