Nice video where you can understand all and learn how is it works. Very helpful.
@SunnyValleyStudio Жыл бұрын
Thanks 👍
@I_wcas11 ай бұрын
I love your video, you don't even know how much this video helped me, you deserve more subscribers, views and likes than you have for your extreme effort. Keep going!!
@SunnyValleyStudio11 ай бұрын
I'm glad that I can help you with my videos 🙂 Thanks a lot for watching! 👍
@lazytocook Жыл бұрын
u sound like a good man. many thanks for this and giving us for free.
@SunnyValleyStudio Жыл бұрын
Thanks for watching 🙂 I'm doing my best to help others but not all I do is for free. In my opinion everyone should get compensated if they do a good job 👍
@Baba-ic4un2 жыл бұрын
Best video for learning Pickup mechanism...I found many videos but this one is the perfect... 😊😊😊
@SunnyValleyStudio2 жыл бұрын
Thanks for watching!
@hh5559 Жыл бұрын
Used the exact script and followed everything up to 8:00 but it won't highlight a Lantern or pillow I set as 'pickable'. Not sure what I'm doing wrong because there's no errors in the scripts and I even assigned the Highlight Script to those models.
@SunnyValleyStudio Жыл бұрын
If it doesn't highlight the objects you could check 2 things. If you can pick up the object I would check if the material has its emission parameter set - since it makes the object glow. If you can't pick up the object it means that our raycast is not detecting the object. In this case the easiest thing is to debug your code or simply "Debug.log" if something is detected by the raycast or not. It might be too short or just blocked by another object.
@kaylafortson9236 Жыл бұрын
Extremely helpful tutorial, thank you!
@SunnyValleyStudio Жыл бұрын
Thanks for watching!
@HFMach10 сағат бұрын
Hey, love the vid, but how do i make a inputactionrefernce, i try to select one in the editor but theres nothing? So i cant use the whole cript cause it give me the error that some fields are not filled, but i can't fil them with inout action references cause idk how to make one? I'm new to coding, love the vids!
@TheKr0ckeR2 жыл бұрын
Thanks for great video, what would you to instead of press to pick up, hold to pick up
@SunnyValleyStudio2 жыл бұрын
Thanks! All you need is instead of action start a coroutine (maybe show a progress bar) and do the action after the time is up. The only additional thing would be to add a *released* action on that button to break from the coroutine if the player let's go of the button too soon.
@themaskedman6253 Жыл бұрын
I tried this but I keep getting this error and I'm not sure what I missed Assets/RaycastPickupDetection.cs(30,35): error CS0246: The type or namespace name 'Highlight' could not be found (are you missing a using directive or an assembly reference?)
@SunnyValleyStudio Жыл бұрын
We don't put this script in a separate namespace. It might be an error with the Highlight.cs script. Do check if you don't see any compilation error / is the script names the same as you type it. The most often issue is misspeling the name or an error in the script that prevents it from being compiled. Less often you actually have to add at the tom "using CustomNamespace". I hope it helps!
@Paaskedrengen6 ай бұрын
Any idea why me item object can go through walls when im holding it?
@SunnyValleyStudio6 ай бұрын
Because we are using Kinematic RB for the item if I am not mistaken. If you make the item to have a Dynamic RB the movement will be jagged but any collision between it and wall will be detected. It is the same problem as you can see in VR games. There is no one simple solution for it. The easiest one is using a dynamic Rigidbody to prevent collision. The most "precise" one is using kinematic RB and coding your own collision reaction - so for example if player tries to push object too far into the wall the Player drops the object (the object stays on the correct side of the wall). Again there are many others so you would have to do a bit of testing / research to find out what works best for you.
@Paaskedrengen6 ай бұрын
@@SunnyValleyStudio Thanks for the answer. Yea i would have hoped that this mechanic was the same as we see in example Portal. Not having any success implementing is so far sadly.
@nikhilbambal5809 Жыл бұрын
I want to drop object in a a specific place in a centre of the place is like a lab device, how can I do that...
@SunnyValleyStudio Жыл бұрын
You could have a separate script like a "socket" where you drop the object and if it is colliding with the socket it is auto attached in the correct spot.
@nikhilbambal5809 Жыл бұрын
@@SunnyValleyStudioCan you make short video on this..or script..
@nikhilbambal5809 Жыл бұрын
Sir, I have a problem, when I droup object the size of object getting small..
@SunnyValleyStudio Жыл бұрын
That is kind of strange. Check the code for any place where we are modifying the scale. It might also happen if you are parenting the object instantiated to some parent object.
@nikhilbambal5809 Жыл бұрын
I want to drop object in a specific place in a centre of the place is like a lab device, how can I do that...
@nikhilbambal5809 Жыл бұрын
@@SunnyValleyStudioThis fixed.. I have one more questions.. Specific place I want to drop the object in centre how can do that..
@deniscooper092 жыл бұрын
Thanks for good videos ☺️
@SunnyValleyStudio2 жыл бұрын
Glad you like them! Thanks for watching 🙂
@xdrocky54172 жыл бұрын
Hello I have small problem I did everything as you did except I used “old input system” and it doesnt work I mean it pickups the items but it doesnt drop them I put debug log on it and it doesnt even print that do you know what could be problem. Thanks
@SunnyValleyStudio2 жыл бұрын
Hey! It should not matter. The logic is *if I am holding something the drop button will drop it* I suspect that you may have a bug in your logic. Check your script again mine (github link) or verify if you ex can debug.log when you press the drop button using your setup. Thos kind of bugs are often caused by us messing up the logic behind reading the input and not the code that we write later. I hope that helps!
@xdrocky54172 жыл бұрын
@@SunnyValleyStudio I checked if I press Q for drop before I pickup anything it will Debug Log the text but if I pickup and then press it will not work I can send you code
@theogagentnate Жыл бұрын
Same thing is happening to me
@theogagentnate Жыл бұрын
For me it was because the if(inHandItem != null) was too high in my update script. So if I had an item in my hands it would skip the rest of my update
@chocolyn.yogurt Жыл бұрын
Is this working for third person player? I'm planning to make the player pickup the item that's in front of him
@SunnyValleyStudio Жыл бұрын
In First Person you can very easily direct a simple Ray at the object. in 3rd person I would use something like SphereCast / Sphere trigger collider to detect object since it might be much harder for the players to point at the object. I mean you can use this method yes but for the sake of having a great experience I would modify the detection to be more forgiving rather than asking you to point exactly at the object. Still it should work.
@REBELHEADGAMES2 жыл бұрын
Hey there I love thr video! Is there any way to put an item to a fixed place? Example: I pick up a vhs tape in one room, and want to put it into a vhs player in the other room.
@SunnyValleyStudio2 жыл бұрын
Hey! The simplest solution to this would be to leave the default "drop" logic and add a trigger collider to the vhsplayer. The vhsplayer could check continuously (or using events to handle swapping items when in range of the collider) in case the player gets close "is the item player is holding a VHS tape?" if so maybe show "press E to use" or if you want to use the same button press add a bool flag that will ignore the default drop logic and instead use some custom logic in vhsplayer update() that check "if drop button was pressed remove the VHS tape from player and play the video"
@lyne.k97806 ай бұрын
Hi how can it be possible to do it with a mixamo character
@SunnyValleyStudio6 ай бұрын
What do you mean exactly? If you want to have a 3rd person camera with a character animated with Mixamo you would use something like SphereCast or OverlapSphere to detect the object to interact with instead of raycasting from the camera (unless you have an isometric camera and its more convenient ). You would just play the "pick up" animation and use animation events to trigger the pickup logic. If you mean FPS + a 3d character the solution would be the same as above.
@mihaistanciu24872 жыл бұрын
Hello. As always very good video. Can you, please, tell us the name of the tool you have on Visual Studio that try to autocomplete the code lines? Thanks.
@SunnyValleyStudio2 жыл бұрын
Hey! It's Visual Studio 2022 with the latest update.
@gloryxdev2 жыл бұрын
press tab twice
@santako2462 Жыл бұрын
NullReferenceException: Object reference not set to an instance of an object Player.Start () (at Assets/Scripts/HelperScripts/Player.cs:45) does not work as it always gives this error and has the new input system and the version of Unity is 2021.3.16f1 and Input System 1.4.4
@SunnyValleyStudio Жыл бұрын
NullRef exception means that something is null. At line 45 of Player script we have *useInput* reference. It is assigned in the inspector of the Player.cs ([SerializeField] private InputActionReference interactionInput, dropInput, useInput;) Are you sure that you have assigned it there? I think I explain it at 11:35
@santako2462 Жыл бұрын
@@SunnyValleyStudio Thank you very much, that’s what I needed
@Survivor_Shelter8 ай бұрын
Why does the item hang in place and not move behind the character?
@SunnyValleyStudio8 ай бұрын
Inside the Player script we do "inHandItem.transform.SetParent(pickUpParent.transform, pickableItem.KeepWorldPosition);" which portents the item to our Player character. We also set the items RigidBody to be kinematic inside PickableIte.cs. That is what makes the item follow the player github.com/SunnyValleyStudio/Unity-simple-Pick-Up-system/blob/main/Player.cs#L78
@carljthatsme94Ай бұрын
Completely new to Unity and have no idea how to get the project files into a project. I tried creating a new project and copying the folders over but there were tons of errors
@SunnyValleyStudioАй бұрын
Hey! Starter Project is a ZIP archive. All you need to do is extract it (Assets, Packages and other folders) into a new folder. The name you give your new folder will be the name of the project. Next just open the Unity Hub, select "Add" button at the top-right and "add project from disk". Next navigate to where your new folder exists and select the folder and at the bottom click "Add Project". This should open the project or if you are missing the exact unity version that I have used it will show an orange exclamation mark - which means that you need to select an editor version that you have installed and convert the project. I hope this helps!
@carljthatsme94Ай бұрын
@@SunnyValleyStudio Amazing, thanks for the response
@nunomonteiro98082 жыл бұрын
Hello, I learned a lot... Thank you. I just have a question. How can I put, for example, on the PickUpSlot a maximum of X number of itemHand I can grab and then using Mouse wheel to change into them? :D
@SunnyValleyStudio2 жыл бұрын
I'm not quite sure what you mean by that. Usually you just need to write a bit more code to extend the current functionality - like when you know what is selected you can listen to scroll wheel and change some parameter before you press pick up key.
@ALLmasked2 жыл бұрын
after learning this by combining sources. i then found this video .... MOTHER! FFFF
@SunnyValleyStudio2 жыл бұрын
Hey! I'm doing my best to create tutorials about whole game mechanics. Maybe you will find some other of my series helpful 😉
@tarabara603 Жыл бұрын
Hi, great video. It definitely helped me with my project. I just have a question. How do I increase the length of the hitRange? I tried increasing the value to 1000 but doesnt change.
@SunnyValleyStudio Жыл бұрын
If you are asking for the Raycast code insider Player.cs you have to multiply " forward * 1000" since Physics.Raycast takes the origin point and the direction so we need to inscreas the length of the direction vector. I hope it helps!
@tarabara603 Жыл бұрын
@@SunnyValleyStudio That was exactly what i needed, thanks
@thurasoe30832 жыл бұрын
Is the Unity OOP course going to be available on Udemy?
@SunnyValleyStudio2 жыл бұрын
Yeah it is. Here is a link www.udemy.com/course/oop-for-unity-devs/?couponCode=30_OFF
@Ratos-2 жыл бұрын
I havent watched this series yet and just want to know if this applies to 2d before i do? thanks.
@SunnyValleyStudio2 жыл бұрын
Hey! This tutorial will give you an idea of how to structure your code base behind a pickup system but obviously the example is in 3d. For a 2d game you would basically need to modify the Raycast logic to use *Physics2d.Raycast* I show how to implement a simple 2d pickup logic in my inventory tutorial (in one of the last parts). You can watch only that part or the whole inventory setup if you are interested. Here is the link to part 18 where I show how to pick up items kzbin.info/www/bejne/r6S4k2mrZZ2og9E
@ghostarda63552 жыл бұрын
hey nice video! but i get a lot of errors like: Assets\Scripts\Player.cs(76,25): error CS0246: The type or namespace name 'InputAction' could not be found (are you missing a using directive or an assembly reference?) or: Assets\Scripts\Player.cs(41,12): error CS0246: The type or namespace name 'InputActionReference' could not be found (are you missing a using directive or an assembly reference?) can you help me pls?
@ghostarda63552 жыл бұрын
and i think its because of this: Assets\Scripts\Player.cs(5,19): error CS0234: The type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
@SunnyValleyStudio2 жыл бұрын
Hey! I think you are missing the new input system package and that is why you have all those errors. Installing it should help! Here is how docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Installation.html If you have used my starter package it should be included. Sorry if it wasn't!
@ghostarda63552 жыл бұрын
@@SunnyValleyStudio oh ok thx but now if i Start unity there is a Tab saying restart unity because native input or something
@crz68352 жыл бұрын
the download of the starter project dont work
@SunnyValleyStudio2 жыл бұрын
Hey! I have just downloaded the project and opened it in Unity 2021.3.1f1 and everything works great!
@crz68352 жыл бұрын
@@SunnyValleyStudio No i mean the link dont work, i press the button to download from the drive and dont does nothing, allready tried it with other browser
@sheldonchettiar924 Жыл бұрын
thanky
@SunnyValleyStudio Жыл бұрын
Thank for watching 👍
@cheapgamer69096 ай бұрын
You have link another vdo for pick item for Mobile game like granny if you have then share me i am still waiting
@SunnyValleyStudio2 жыл бұрын
Part 2 -> kzbin.info/www/bejne/ql66nIOVit6lnbc
@matyi_on_-5fps...FORTNITE Жыл бұрын
XD
@GGamess2 жыл бұрын
the build of the game does not work backlight items
@SunnyValleyStudio2 жыл бұрын
Building a game is different depending on a platform and the project. Your game might work well in the editor but might require modifications when creating a build. That is why it is useful to try to build the game as soon as the first prototype to avoid major changes.
@thelegendarymushroom80 Жыл бұрын
It won't drop down the item, but I have the exact same code :(
@SunnyValleyStudio Жыл бұрын
Maybe for some reason the DROP action input is not assigned / is not set correctly in the Player.cs script or in the Input Actions asset where we have assigned keyboard keys to the Drop action?
@thelegendarymushroom80 Жыл бұрын
@@SunnyValleyStudio I did check it multiple times and it seems fine. But it's like the buttons till won't work :( it's okay tho