hi i have dozens of videoes on youtube for unity. didn't got anyhting but your two videes changed my life.... where were u all the time : )
@xlaugts1516 жыл бұрын
Hey NIT, Thanks very much for the nice words, it's good to know I'm able to help someone. If you need any help let me know :)
@thoughtFormMax6 жыл бұрын
Very helpful starting point.
@xlaugts1516 жыл бұрын
Thank Max, that's the purpose of this video just give you guys a starting point. :)
@graphicsseion7904 жыл бұрын
Thanks so much mate, this is the only one tutorial thats explain very simple to move on VR. THANKS!
@maheshbhegde10992 жыл бұрын
It was very useful for doing a class project. Thank you.
@yasminadrianasanchez2415 Жыл бұрын
Thank you so much, this help me a lot😊
@markbakker976 жыл бұрын
Very simple script to do VR walk ... thanks for the tutorial!
@xlaugts1516 жыл бұрын
Hi Mark, I'm happy you liked. Thanks for the comment.
@MaximuszEsala5 жыл бұрын
hey man im a newbie your videos helped me alot but im having trouble with moving i get the following error please help !!! A namespace cannot directly contain members such as fields or methods
@xlaugts1515 жыл бұрын
Hey Maximus, This might be happening because of some spelling mistake or some () in a wrong order. Have a look on your script with attention and see if you can spot any small mistake. Thanks for watching my friend :)
@alexdiamantis91416 жыл бұрын
Ok so since this is for an Android phone/device, how would a person interact with the controls u show? There is no mouse to click on a phone ect ect
@xlaugts1516 жыл бұрын
Hey Alex, Good question, the mouse on phone device works as touch screen. So when I use it to interact is the same as someone using the touchscreen and the gooogle cardboard has that on the side.
@thedarkshadoww97112 жыл бұрын
I know it's been a while since you created this video but I'm would be great if you can help me a problem. The player moves just fine, but I want to have it a little bit of inertia, like keep moving till the button is pressed, and when it's released the player slows down gradually coming to a stop. I cannot work out the logic for this.
@Novia55555 жыл бұрын
This is so useful.. please make another video about Google Cardboard or VR on mobile, cz out three lacking this kind of tutorial ...
@omarkhedr58553 жыл бұрын
Thanks for this video!! What was Fire1 used for?
@peterquill7266 жыл бұрын
Hi, can I move player using Unity timeline instead? I don't need any input just want the player to move along position I've key-framed.
@l.xguterres5 жыл бұрын
Obrigada! Ótimo tutorial!
@daniltimofeev65663 жыл бұрын
Я тоже обрыгался! :)
@damurlive5 жыл бұрын
When the camera collision with the cube, the camera is fall down, i mean fall on the ground (hope you know what i mean), and sometimes when i walking and turn right of left, the cameras also fall too ... How to fix it ?? Thank you 🤗🤗🤗
@xlaugts1515 жыл бұрын
Hey Cops, That might be happening because of the rigibody of your player. You see that the rigibody has a constraints options that you can freeze the rotation of your character. Try to do that do some tests and let me know if that wokred. Thanks for watching :)
@damurlive5 жыл бұрын
@@xlaugts151 haha ... I'm forget to check freeze rotation and it fix now ... Thanks 👍👍👍
@Esil__5 жыл бұрын
hey my dude to be honest ur tutorial is good for beginner like myself .... if ur not that busy with anything i would like to suggest a popup message if u gaze on a game object for ur next tutorial
@xlaugts1515 жыл бұрын
You mean instead of activating a button, you want a message to pop up on the screen ?
@BlunderBoyNehruJ5 жыл бұрын
@@xlaugts151 yes
@xlaugts1515 жыл бұрын
@@BlunderBoyNehruJ I wrote down that on my list of tutorials to do.
@ajsklandsoftverse_18245 жыл бұрын
you are great man
@xlaugts1515 жыл бұрын
Hahaha You are great too!!!
@ELPIRATATUQUE6 жыл бұрын
I'm trying to code a reverse button but not getting the "if" "else" part right, any ideas? Everything else worked like a charm :)
@xlaugts1516 жыл бұрын
Hi Reinaldo, Sorry for the delay I took some days off for the holidays. Could you share a bit more details how are you doing that ? Maybe I could help. The reverse button you added is to make the player walk backwards is it ?
@michaelwilson71596 жыл бұрын
Legend....keep posting
@xlaugts1516 жыл бұрын
Hi Michael, Thank you very much, I now studying a lot and I will bring more videos later about VR. :)
@rajveerjolly79334 жыл бұрын
Thank you so much for this wonderful tutorial ! I really appreciate it.
@abhijitbhushan6 жыл бұрын
I don't want it to move when the reticle pointer is pointed at something. Could you help me with that? Right now, I've got a panel on which a button needs to be pressed to change the scene. But it still moves a tiny bit when the button is pressed, how can I avoid this? Really appreciate the video, saved me a lot of time and energy, thanks!
@xlaugts1516 жыл бұрын
Hey friend, sorry for the delay. Could you provide me a bit more details about what are your trying to do ? You dont want the player to move when you point at something is it ? Let me see if I understood right, you want your player to autowalk and if you point at something stops ??? Sorry if I got it wrong. Cheers
@abhijitbhushan6 жыл бұрын
@@xlaugts151 Not exactly, so right now, when I press the button on google cardboard the player moves. But suppose I have a button in my VR scene which the player needs to press to change the scene. When the reticle pointer is aimed at this button, it changes from a dot to a circle, yeah? This is when I don't want any movement when I press the google cardboard button. The movement functionality should be turned off when the reticle pointer is a circle. I hope you understood, thanks for your reply!
@abhijitbhushan6 жыл бұрын
In your above video, when you look at the cube and press the button, the player moves a tiny bit, I don't want that to happen. Is there any way to prevent this? The cube should be changing the direction of rotation without the player moving. Thanks!
@xlaugts1516 жыл бұрын
@@abhijitbhushan I finally got it what you mean, yeah there is a way I just don't know yet hahahaha. I'm going to make some test and I let you know, I have some idea how to do it I think, basically what I am thinking is if the player looks at the button or object they want to interact we could have a bool variable that will deactivate the walking system and once he stops looking it activates again. I'm not sure if is going to work but I let you know later on ok ?
@xlaugts1516 жыл бұрын
@@abhijitbhushan I found a solution: public float playerSpeed; public bool canWalk = true; // Update is called once per frame void Update() { if (Input.GetButton("Fire1") && canWalk) { transform.position = transform.position + Camera.main.transform.forward * playerSpeed * Time.deltaTime; } } public void CanWalk() { canWalk = true; } public void CantWalk() { canWalk = false; } I created a variable "canWalk" that needs to be true for the player to be able to walk. If you look let's say to the cube for example, the cube has that component event Trigger you can use pointer enter and exit to call those two methods, so if your player is looking at the cube it will call CantWalk() and the bool is going to be false disabling the movement and on pointer exit you call CanWalk() enabling the movement again. Let me know if that works
@georgemarneras75884 жыл бұрын
Newbie here. I used the script but there's an error "The name 'input' does not exist in the current context". What should I do?
@GS-ef5ht6 жыл бұрын
Very helpful. Thank you!
@xlaugts1516 жыл бұрын
Thanks GS
@tuguldurjigjidsuren3916 жыл бұрын
Code is not working for me some reason. It's keep giving me nullreferenceexpection error. do you know about this problem? (Code is exactly the match)
@xlaugts1516 жыл бұрын
Hi Adventure, If you double click it is showing any part of your script that is giving the error ???
@tuguldurjigjidsuren3916 жыл бұрын
@@xlaugts151 I double clicked it and it takes me to the transform.position =transform.position + Camera.main.transform.forward * speed * Time.deltaTime part
@xlaugts1516 жыл бұрын
@@tuguldurjigjidsuren391 Check if the camera that's inside the player has the tag MainCamera, that could be the error.
@domenicolopez61144 жыл бұрын
Hi mate, great video.
@niharmamidipudi10296 жыл бұрын
Thank you very much for this video. I am having some build issues with unity 3d on my laptop is there anyway I can contact you for help
@xlaugts1516 жыл бұрын
Hi Nihar, Yes, what's the issue you're having now ? Thanks
@Un_colombiano_en_roma_italia5 жыл бұрын
Te lo voy a decir en español eres el tuyo amo me salvaste de una
@xlaugts1515 жыл бұрын
Gracias my Fried :)
@audacityfilmsproductions53346 жыл бұрын
I 100% love you! Thank you!!!
@xlaugts1516 жыл бұрын
Thank you! :)
@zhyli14516 жыл бұрын
Very helpful and clear guide! But I have a problem here, it works well in my Game view, however on my phone the player can't walk, I just have a 360 view but not walking any more. Do you know what happens?
@xlaugts1515 жыл бұрын
Hey Zhy, How are you doing to move ? Touching the screen ? There is also one problem with the latest version of the SDK the onClick is not working but I am not sure if that's your case. Let me know how are you doing to get the input, because in the video I use Fire1 which is the same as touching the screen. Thank you for Watching :)
@damurlive5 жыл бұрын
This problem also happen to me too .. I can't move on android, and i use your code with "Fire1" ... Can you help us ???
@xlaugts1515 жыл бұрын
@@damurlive That problem might be happening because of the SDK but I have to do some test and I will let you know guys
@raidrunnerss6 жыл бұрын
subbed, thx for your job
@xlaugts1516 жыл бұрын
Hey Cyborg, Thanks very much! :)
@josepholiverquesada20416 жыл бұрын
how am I able to walk using vr remote(joystick)
@xlaugts1516 жыл бұрын
Hi Joseph, Thanks for asking, I'm creating a tutorial about that. There are a lot of people asking me about it, could you let me know which controller are you trying to use ? This will help me to find a solution for it. Thanks :)
@harletperniaespinoza93646 жыл бұрын
@@xlaugts151VR Box , please
@xlaugts1516 жыл бұрын
@@harletperniaespinoza9364 I will release one this week
@xlaugts1516 жыл бұрын
Hi @@harletperniaespinoza9364 I released a tutorial showing the movement with controller: kzbin.info/www/bejne/i3PSqKR9l79sl5Y Let me know if that worked for you please. :) I hope you enjoy
@josepholiverquesada20415 жыл бұрын
@@xlaugts151 Thank you so much! best tutorial for VR player movement. code efficient. 👌🏻
@katalinabiondi4 жыл бұрын
Brilliant!!
@ivanmurataya40176 жыл бұрын
Do you have an app on the playStore, I would like to se a complete VR app :) Great Job! you are helping me a lot!
@xlaugts1516 жыл бұрын
Hi Ivan, I don't have one. I actually just finished one VR game with these mechanics to grab and release but I'm delaying to publish. Not sure why hahaha but soon I will release it. It's very simple one. I will let you know once I publish and thanks for asking. Im happy to help by the way!
@sexypotato4 жыл бұрын
Awesome!
@Jusete26 жыл бұрын
Awesome tutorial, but there is a problem: How can I push the button when app is in mobile cardboard? is it possible? Thanks, I like so much your work .
@xlaugts1516 жыл бұрын
Hi Jose, Oh thanks for your comment, I'm not sure if I understood right, but if you asking about how to push the button when the app is on the phone, you just touch the screen and it will change the rotation. Let me know if I got it right or not hahaha. Thanks :)
@Jusete26 жыл бұрын
Hi again! Thanks for write me. void Update () { if (Camera.main.transform.localRotation.x > 0.0f) { transform.position = transform.position + Camera.main.transform.forward * playerSpeed * Time.deltaTime; } } If you watch down the player will move. Do you like? it is so simple but may be a temporal solution for a easy game. Thanks again for your tutorials.
@xlaugts1516 жыл бұрын
Hi Jose, Yes this also works, it will make the player walk automatic, or you can just leave like that: void Update () { transform.position = transform.position + Camera.main.transform.forward * playerSpeed * Time.deltaTime; } Let's say you want to make the player walk when it looks down you could do like this: public float walkAngle = 30.0f; // Angle that will make the player start walking public float playerSpeed; public Transform cam; // Don't forget to assign the main camera to this variable on the inspector // Update is called once per frame void Update () { if(cam.eulerAngles.x >= walkAngle) { transform.position = transform.position + Camera.main.transform.forward * playerSpeed * Time.deltaTime; } } So every time the player looks 30.0 degrees down it will move foward
@Jusete26 жыл бұрын
Fantastic, It is better. (eulerAngles) Thanks!
@xlaugts1516 жыл бұрын
You're welcome :)
@RFixT_Swaps4 жыл бұрын
I have problens with first code I wrote this in visual studio 2019: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerWalk : MonoBehaviour { public int playerSpeed; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.GetButton("Fire1")) { transform.position = transform.position + Camera.main.transform.forward * playerSpeed * Time.deltaTime; } } }
@visni6434 жыл бұрын
hey man, i can't solve the problem of flying, in my game i shouldn't fly, but because of the script i can
@AnnaConstantinova5 жыл бұрын
My player is not able to move forward with script... help!
@xlaugts1515 жыл бұрын
Hi Anna, Could you share you script for me to have a look?? Also could you let me know if there is any error showing ?? Thank you for watching :)
@AnnaConstantinova5 жыл бұрын
@@xlaugts151 Thank you so much for the reply! I have Mac and free version of Unity. (I don't know if it matters but I didn't import x86 and Mac in Google VR package like in your tutorial.) Error message: "Virtual Reality SDK Cardboard is not supported in Editor Play Mode. Please Build and run on a supported target device. Will attempt to enable None instead." Here is my script: using System.Collections.Generic; using UnityEngine; public class PlayerWalk : MonoBehaviour { public int playerSpeed; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if (Input.GetButton("Fire1")) { transform.position = transform.position + Camera.main.transform.forward * playerSpeed * Time.deltaTime; } } }
@03695005 жыл бұрын
@@AnnaConstantinova You code seems to be right. By the message Unity is showing it might be something with a Unity not recognizing the SDK version I found a article that might help you to solve the problems: stackoverflow.com/questions/44774254/unity-vrdevice-cardboard-not-supported-in-editor-mode-please-run-on-target-dev You could also watch the video on how to create your first VR app and see if the settings are ok.
@monamoinipour89755 жыл бұрын
Thank you it works out! I just have one problem that I cannot fix, but maybe you (or someone else) can help me: The player walks in every direction you look, which is fine, but he also walks through the floor and other objects too. He basically walks everywhere (and through everything) you look at. Any ideas how to fix this? :D
@feelreality12734 жыл бұрын
Omg I've the same issue, do you have a solution for this?
@sarojrani59162 жыл бұрын
@@feelreality1273 you should make evry object a physics object or your player a physics object 🗿or I am wrong i think
@alexsafayan76846 жыл бұрын
The mic isn't the best, but good tutorial!
@xlaugts1516 жыл бұрын
Hi Alex, Thanks for your comment, yes know my mic is definitively not the best hahaha... but I wanted to see if I could make some videos before buying the a better one. I will soon I feel that I need at least a decent one.