Unity VR Tutorial 2018 - Grab / release object for Google cardboard

  Рет қаралды 14,967

Xlaugts

Xlaugts

Күн бұрын

On this tutorial I will show a simple way to grab and release an object on Unity for google cardboard.
This video was made in 2018 and as VR still new to work with it may changes over the time how to set up but for now this is working fine, I am being able to create a lot of fun game mechanics using these techniques.
Twitter:
Xl...
Instagram:
/ hpirani
If you have any suggestion for a video or tutorial please leave a comment bellow.

Пікірлер: 55
@ObiSam2017
@ObiSam2017 4 жыл бұрын
How do i make it so there are multiple objects to pick up
@yasminadrianasanchez2415
@yasminadrianasanchez2415 Жыл бұрын
Thank you so much, this help me a lot😊
@syedaalena7902
@syedaalena7902 2 жыл бұрын
Which button youre presing for grab and release from controller?
@atiqahrosslan
@atiqahrosslan 4 жыл бұрын
Why I cannot interact with the ball? However, I can grab the ball without interact with the ball.
@shivamhire9869
@shivamhire9869 5 жыл бұрын
I did some modification to those scripts and came with a alternative game type where we pick up and carry objects to another place to trigger a event like "Open the door when cube place on platform". Also i integrated a movement script that can be used via a X-box controller . The only issue i have with movement is that the player moves irrelevant to the direction of the head. Great Video . Subscribed and liked. would appreciate if you could shed some light on the movement issue i am having. Keep Developing ..cheers.
@xlaugts151
@xlaugts151 5 жыл бұрын
Hi Shivam, Thanks for watching. About the issue with the movement, I had the same and it took me days to figure it out. Have a look on this video kzbin.info/www/bejne/i3PSqKR9l79sl5Y it might help you with the controller. If does not help you let me know we can figure this out.
@shivamhire9869
@shivamhire9869 5 жыл бұрын
@@xlaugts151 Tried this and works marvelously . Did a few Tweaks and now i can pick all the objects that are attached to a certain script called "grab_able" . Using this in making a puzzle game for placing shapes on their respective platforms to unlock the next level. Thanks for these tutorials .. you are a life saver.
@xlaugts151
@xlaugts151 5 жыл бұрын
@@shivamhire9869 I'm happy to help. If you have any other suggestion for a video let me know.
@shivamhire9869
@shivamhire9869 5 жыл бұрын
@@xlaugts151 yes I would very much love to know how to implement a jump mechanism in this same VR platform ..as it's locked by default I guess. That could be a great video
@xlaugts151
@xlaugts151 5 жыл бұрын
@@shivamhire9869 That would be great, thanks for suggesting
@beFrah
@beFrah 4 жыл бұрын
The type or namespace name 'Grab' could not be found (are you missing a using directive or an assembly reference?) .NEED HELP :)
@helminurulwahid2758
@helminurulwahid2758 5 жыл бұрын
Hello, iam trying to make description text apear when i facing the object. For example, when i am facing the BOX, will apear description in the frame "It is A Cube" and if i am facing the Ball it appear "It is a Sphere Object". Do you know to to do this?
@xlaugts151
@xlaugts151 5 жыл бұрын
Hi Helmi, Let's see if I understood right. So if we look at the cube it will pop up a message saying something like "This is a Cube" is that what are you trying to do ? If yes, I have other people asking for that and expect a tutorial about that soon. Thanks my friend
@avita2738
@avita2738 4 жыл бұрын
Assets\PlayerGrab.cs(19,38): error CS1503: Argument 1: cannot convert from 'UnityEngine.GameObject' to 'UnityEngine.Transform'
@JoshyHJoshy
@JoshyHJoshy 6 жыл бұрын
Excellent Tutorial. One question: The "Event Trigger" component is a Unity component. Right? So, can we use the "Pointer Click" events and the rest of them in a regular Unity project or do we necessarily have to import GVR so we can have a reticle pointer interaction?
@xlaugts151
@xlaugts151 6 жыл бұрын
Hi H Miri, Yes you can, those GVR components are only for VR, but the onClick and PointerClick you can use in a regular project. Just the onPointer I'm not sure how it's going to work without the reticle pointer. I'll have a look how it could work and let you know once I discover. Thank you! :)
@manishabalani6427
@manishabalani6427 4 жыл бұрын
can you tell me if I want to place the ball in the new position only and not bring it back to original position what modifications need to be done in the script?
@chuy6380
@chuy6380 6 жыл бұрын
Hello, I have been following your tutorials flawlessly until here. When I grab the ball, it picks it up so fast and puts it back. I have to tap once on my Mac air to be able to grab it because a click grabs it and puts it back instantly. When I am able to grab it, I can tap again to put it back and if I tap again without looking at it, it grabs it again. I have to walk away and tap a few times for it not to grab it. Same thing when simulating on phone. Not sure what the issue is. I have gone over the steps several time.
@xlaugts151
@xlaugts151 6 жыл бұрын
Hi Jesus, Have a look on this video kzbin.info/www/bejne/i5-2h4FvbqZ3prs On this video we improve the grab and release ball system it might help with your problem. I add few more steps to make the player grab and release a the ball.
@nicologiardini99
@nicologiardini99 3 жыл бұрын
Hi, I have a problem releasing the ball .. it doesn't work. I can't understand why. I tried to review the video but I don't understand why
@darkfrost5672
@darkfrost5672 5 жыл бұрын
I hope you create and post a turorial about how open and close the door and how to walk in stairs up and down
@esfar78
@esfar78 6 жыл бұрын
can i get the full project please i am having some difficulties setting up google VR i am very new to all this.
@xlaugts151
@xlaugts151 6 жыл бұрын
Hey Crazy Times, Here is the link: github.com/Xlaugts/VR-Tutorials if you have any question let me know. Thanks
@edafeclintiduh3754
@edafeclintiduh3754 5 жыл бұрын
Hi, I understand all that you did and want to say thank for being detailed in your explanations. However, my question is how can I grab an object and drop it in any location within my scene.
@xlaugts151
@xlaugts151 5 жыл бұрын
Hi Edafe, in your case you want to drop the object and not trow it right ? There are 2 ways I can think of doing it, of course just writing here wont be possible to explain. I can do a video showing it, thanks for the idea hahaha
@FahmiRais
@FahmiRais 5 жыл бұрын
@@xlaugts151 same issue with him, show us how to do it! :)
@xlaugts151
@xlaugts151 5 жыл бұрын
@@FahmiRais I am going to show u soon I will release the video
@visni643
@visni643 4 жыл бұрын
hey man, i have a problem that, i need to destroy the object, cause, in my project, we have a lot of objects, and i need to take them to a location, when they reach that location, the object is destroyed, but you pass a gameobject as reference, so i cant take the others, pls help
@AdamBhuana01
@AdamBhuana01 4 жыл бұрын
Great Lessons
@yasVFX
@yasVFX 5 жыл бұрын
How can we grabb an object without clicking on the object juste by the reticle pointer
@xlaugts151
@xlaugts151 5 жыл бұрын
Hey, Look I have this tutorial that shows how to create a reticle pointer to interact with a button. You can combine that with this tutorial.
@xlaugts151
@xlaugts151 5 жыл бұрын
Here is the link kzbin.info/www/bejne/sJWxc42pf8mab8U
@xiaocao1866
@xiaocao1866 4 жыл бұрын
thanks
@damurlive
@damurlive 5 жыл бұрын
When I add script for release the object, i can't grab the object ... Dan you help me ??? Thanks
@xlaugts151
@xlaugts151 5 жыл бұрын
Hey Cops, Could you share the script with me Is there any message error showing ? Thanks
@MaxiCrows
@MaxiCrows 5 жыл бұрын
@@xlaugts151 public class Grab : MonoBehaviour { public GameObject ball; public GameObject hand; bool inHand = false; Vector3 ballPos; // Start is called before the first frame update void Start() { ballPos = ball.transform.position; } // Update is called once per frame void Update() { if(Input.GetButtonDown("Fire2")){ if(!inHand){ ball.transform.SetParent(hand.transform); ball.transform.localPosition = hand.transform.localPosition; inHand = true; }else if(inHand){ this.GetComponent().enabled =false; ball.transform.SetParent(null); ball.transform.localPosition = ballPos; inHand = false; } } } }
@MaxiCrows
@MaxiCrows 5 жыл бұрын
release dont work
@MaxiCrows
@MaxiCrows 5 жыл бұрын
@@xlaugts151 I finally can improved the release making enabled the pointer Exit event ;)
@xlaugts151
@xlaugts151 5 жыл бұрын
@@MaxiCrows Is there any error showing up?
@cesarguadalupefierrocaball7991
@cesarguadalupefierrocaball7991 5 жыл бұрын
When i grab de ball, this one goes down, so i can´t put it again where i grabed it
@xlaugts151
@xlaugts151 5 жыл бұрын
Check is the rigidbody component of the ball has is Gravity unchecked. Thanks for watching :)
@ivanmurataya4017
@ivanmurataya4017 5 жыл бұрын
the OnPointUP is not working :( i dont know why :(
@xlaugts151
@xlaugts151 5 жыл бұрын
Ivan is there any way to share with me the project ? Some people are having similar issue and I'm not being able to reproduce to find a solution for it. If I have a change to look yours I might find some.
@PDR-fm5ob
@PDR-fm5ob 5 жыл бұрын
add GVRControllerMain
@monicapeters3458
@monicapeters3458 5 жыл бұрын
where can we find PlayerGrab script?
@xlaugts151
@xlaugts151 5 жыл бұрын
Hey, have a look on this link where you can find the project github.com/HenriquePirani/KZbin-2D-Game
@monicapeters3458
@monicapeters3458 5 жыл бұрын
@@xlaugts151 thank you :)
@rovaldyapplyrs3918
@rovaldyapplyrs3918 5 жыл бұрын
How can we do this with multiple objects?
@xlaugts151
@xlaugts151 5 жыл бұрын
Hey Rovaldy, Thanks for watching the video, I can do a video about it. It's not that complicated to do it, I use tags to identify the objects I am picking.
@rovaldyapplyrs3918
@rovaldyapplyrs3918 5 жыл бұрын
Yes please, that would be very helpful
@FahmiRais
@FahmiRais 5 жыл бұрын
@@rovaldyapplyrs3918 is there any solution/steps how to do it with multiple objects? im not really understand how to use tags in unity. have ur problem solved?
@yasVFX
@yasVFX 5 жыл бұрын
could you please give us all the scripts
@xlaugts151
@xlaugts151 5 жыл бұрын
Hey YB I have some of them here github.com/HenriquePirani?tab=repositories
How Hollywood Shot Actors with Arrows before CGI
15:12
Tyler Bell
Рет қаралды 3,5 МЛН
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 122 МЛН
Wait for it 😂
00:19
ILYA BORZOV
Рет қаралды 11 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 84 МЛН
Happy birthday to you by Secret Vlog
00:12
Secret Vlog
Рет қаралды 6 МЛН
AI Boxing Got me Wheezing
15:06
cozmouz
Рет қаралды 412 М.
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 1,2 МЛН
Building a REAL pawn that transforms into a queen (automatically)
14:12
Works By Design
Рет қаралды 1,8 МЛН
AI Learns How To Play The Worlds Hardest Game
8:21
Tyler Mommsen
Рет қаралды 481 М.
Getting Started With ARFoundation in Unity (ARKit, ARCore)
31:20
The Unity Workbench
Рет қаралды 461 М.
The Most Impressive Scratch Projects
11:00
DenshiVideo
Рет қаралды 5 МЛН
Gaze Menu Interaction Virtual Reality With Unity 2017.3 & Google VR
27:43
Denys Gamers Tutorial
Рет қаралды 35 М.
Player Object Interaction In Unity For Beginners
9:51
Joe Rickwood
Рет қаралды 23 М.
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 122 МЛН