How to Create a Whiteboard in Unity VR - A Step-by-Step Guide

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2024

ความคิดเห็น • 211

  • @JustinPBarnett
    @JustinPBarnett  3 ปีที่แล้ว +11

    Download the Project (for FREE): www.vrcreators.io/codedownloads

    • @SahithNayudu
      @SahithNayudu 7 หลายเดือนก่อน +1

      This link is not working. Can have the latest link?

    • @soursdeyny1687
      @soursdeyny1687 6 หลายเดือนก่อน

      @@SahithNayudu same here

    • @SahithNayudu
      @SahithNayudu 6 หลายเดือนก่อน

      @@soursdeyny1687 yep.. Waiting

    • @HoaNguyen-bm3rq
      @HoaNguyen-bm3rq 5 หลายเดือนก่อน +1

      can i have the lastest link , the link is not working

  • @nolanrux7866
    @nolanrux7866 2 ปีที่แล้ว +6

    THANK YOU.
    I'm doing my masters thesis on Project Management in a virtual space using only hand tracking, and I needed to be able to write on sticky notes in VR, and was freaking out that I wouldn't be able to do it before testing. This tutorial literally saves my paper.
    So again, thanks from the bottom of my heart.

  • @neilfosteronly
    @neilfosteronly 3 ปีที่แล้ว +13

    Not sure why I don't have Enumerable as an option. At 11:30 in video. Using Hurricane VR. Only have IEnumerable as an option with no .Repeat.
    Solved from discord member. Add "using System.Linq;" to start of script

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว +2

      Glad you got it fixed! Discord really is the way to go if you have questions

    • @neilfosteronly
      @neilfosteronly 3 ปีที่แล้ว +1

      100% true. But I like having answer on youtube also. Because much easier for me to find again if I have the same problem in the future.
      Thanks for all your work.

    • @pirvudaniel6976
      @pirvudaniel6976 2 ปีที่แล้ว +1

      @@neilfosteronly yoo, you saved me with this comment , much appreciated

    • @KevinSizemore
      @KevinSizemore 2 ปีที่แล้ว +1

      Thanks tons! You got me working.

    • @pratikmane566
      @pratikmane566 2 ปีที่แล้ว

      Great ! Thanks

  • @kinnikunky
    @kinnikunky 3 ปีที่แล้ว +8

    Your tutorials are SO good! I can't believe you don't have tons more subs. You've inspired me to get back into VR programming after a few years break! Thank you!

  • @RiggedVirtualReality
    @RiggedVirtualReality 3 ปีที่แล้ว +7

    I was just about to dive into working this out myself, looking forward to seeing how it's done!

  • @generichuman_
    @generichuman_ 2 ปีที่แล้ว +10

    For everyone that's having the jittery marker issue, first check and make sure that the handle and marker tip transforms are reset to zero so they are in the same position as the marker object ( with the exception of the tip which has to be moved along the y axis to be at the end of the handle). Another thing, is if you have a character controller on your player, that will cause the marker to jitter when it hits the capsule collider. I know adding one wasn't in the vid, but I wanted to interact with objects so I added one myself, and it caused problems so it's worth mentioning.

  • @unityworld1619
    @unityworld1619 3 ปีที่แล้ว +11

    amazing, thanks Justin!!. Could you please make a video on how to draw in 3D space please, I would really appreciate it

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว +3

      Great suggestion! That'd be super cool

    • @KevinSizemore
      @KevinSizemore 2 ปีที่แล้ว

      @@JustinPBarnett I would like this, too...thanks for all the great toots

  • @bjrn8046
    @bjrn8046 3 ปีที่แล้ว +6

    "And we'll change all these wives into exes" - Justin P Barnett @ 17:57

  • @TOsmartFORknowledge
    @TOsmartFORknowledge 3 ปีที่แล้ว +3

    So appreciative of all the VR tutorials you've put out. Always super helpful stuff you can't find many other places!

  • @lexihenrion1940
    @lexihenrion1940 ปีที่แล้ว +3

    Any idea how to make the whiteboard grabbable so it can be moved around? I tried adding a XR grab interactable component and rigidbody, but for some reason the markers then don't write on the whiteboard.

  • @francescagreetham1804
    @francescagreetham1804 2 ปีที่แล้ว +2

    Love watching your videos - you explain everything so well. I wasn’t even thinking about making a whiteboard but I just love learning from you!

  • @ugochukwunwankiti6030
    @ugochukwunwankiti6030 ปีที่แล้ว +2

    @JustinPBarnett I followed the instruction in this video and it worked perfectly fine. However, When I add a material with a texture like the outline of a picture to the canvas and I enter playmode, the canvas automatically turns back to being blank. Any ideas on how I can make this work?

  • @EvroCraft
    @EvroCraft 3 ปีที่แล้ว +3

    100th like! You have helped me sooo much in VR game development, thanks so much!

  • @Lachesis_steven
    @Lachesis_steven 2 ปีที่แล้ว +3

    Thanks Justin, you are always my teacher! I tried your code, but I find that the plan of "setPixels() + Apply()" are too slow especially when I use a big texture size.And it get worst when I made a blackboard eraser in this way--
    I have to use many small square to approximate the shape of blackboard eraser Now I find a way to improve it that we can send an extra
    "trial texture" to a shaderGraph, then mix it with original texture, and the way to draw the trial texture is using the `rendertexture` and `Graphics.DrawTexture`. After that, almost all the calculation
    happened in GPU, I finally get a fps improvement for nearly 300%!

    • @emirhanyilmaz9695
      @emirhanyilmaz9695 2 ปีที่แล้ว

      Hi, can you give more detail about this technic?

    • @Lachesis_steven
      @Lachesis_steven 2 ปีที่แล้ว

      @@emirhanyilmaz9695 firstly you can see this video: th-cam.com/video/ftCyZ7F5q9E/w-d-xo.html
      this video is about a "snow trail”effect,it create the "trial texture" using VFX system, but it still not fast enough.
      I change the method in this video on how to create the "trial texture" by create a `RenderTexture` and call the `Graphics.DrawTexture()` to draw a small pen texture(a sample penSize*penSize texture created in runtime) on the `RenderTexture` when the pen hit the board----instead of setPixels() and Apply()

    • @emirhanyilmaz9695
      @emirhanyilmaz9695 2 ปีที่แล้ว

      @@Lachesis_steven thanks bro

  • @generichuman_
    @generichuman_ 2 ปีที่แล้ว +5

    Another thing you could do is calculate the distance between last pos and current pos, and scale the number of interpolations with this value. Otherwise, you're doing 100 steps regardless of the distance between frames.

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Yea that’s a great tip to increase performance

  • @sissond
    @sissond 3 ปีที่แล้ว +2

    Good timing, need this for a project

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว +2

      Awesome! Hope it answers all your questions

  • @stanleyhoptroff
    @stanleyhoptroff 3 ปีที่แล้ว +1

    not seen your channel in a while congrats on all the new subs :)

  • @anjalia2246
    @anjalia2246 2 ปีที่แล้ว +1

    Hi Justin, thank you for this tutorial, exactly what I was looking for!

  • @MatthewCawley
    @MatthewCawley 2 ปีที่แล้ว

    Subscribed simply because you are a fellow Rider user :D Great tutorial by the way - it has helped me understand the logic behind realtime painting for my own project. Thank you :)

  • @gamer-qd6cg
    @gamer-qd6cg 2 ปีที่แล้ว +3

    At 11:22 enumerable doesn’t work anymore at fixes? Edit I fixed it by using system.linq in the beginning of the script

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      Glad you got it working! Yea those using statements are sneaky sometimes

  • @balikif
    @balikif 2 ปีที่แล้ว +1

    Such an amazing channel you got here love it!!!

  • @unruliestcat
    @unruliestcat ปีที่แล้ว

    Thank you so much for this amazing tutorial, it was really perfect

  • @ZuluagaLaura
    @ZuluagaLaura 3 ปีที่แล้ว +2

    This guy is simply amazing!

  • @AnikenSkiwalker
    @AnikenSkiwalker 6 หลายเดือนก่อน

    great video. suppose I have a multiple amount of whiteboards in the world would I have to attach this script to every single whiteboard in order for the marker to draw on them? What would be the easiest way to do this?

  • @НикитаМордик-к8ф
    @НикитаМордик-к8ф 3 ปีที่แล้ว +1

    nice video man, thx for new information and thx for your previous videos, they helped me in my current work.

  • @savbarnett2798
    @savbarnett2798 3 ปีที่แล้ว +3

    Good job babe!❤️

  • @UnityVR
    @UnityVR 3 ปีที่แล้ว +1

    Great video Justin!

  • @alessio.lan74
    @alessio.lan74 3 ปีที่แล้ว +1

    Thank you Justin for your great work

  • @Frenuellcrackser33
    @Frenuellcrackser33 3 ปีที่แล้ว +1

    Awesome this is going to be a great starting point !
    I recently had the idea to make a VR graffiti wall :D

  • @brianbarnett208
    @brianbarnett208 3 ปีที่แล้ว +1

    This is super cool! Great job!

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว

      Thank you! Cheers!

    • @brianbarnett208
      @brianbarnett208 3 ปีที่แล้ว +1

      @@JustinPBarnett I especially like the anti-gravity pen 😀. Call it a feature 😂

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว

      @@brianbarnett208 😂😂😂 haha yea that surprised me

  • @sarahrietkerk2212
    @sarahrietkerk2212 2 ปีที่แล้ว

    This was extremely helpful and cool!! Thank you so much!

  • @fernandocgi3874
    @fernandocgi3874 2 ปีที่แล้ว +1

    Awesome video! I hope you dont forget to make the erase part!

    •  2 ปีที่แล้ว +1

      you got it?

    • @fernandocgi3874
      @fernandocgi3874 2 ปีที่แล้ว

      @ Kinda, im not rly an dev im just a designer coding for hobby heh

    • @lexihenrion1940
      @lexihenrion1940 ปีที่แล้ว +1

      @@fernandocgi3874 Hi! How did you do this? When i tried to make an eraser (basically by making a marker with a color set to the color of the board) it didn't come out right. Even if both materials were the exact same (ex. pure white), the eraser always acts like a highlighter, showing up brighter than the board (maybe because it doesn't obey shadows? Unsure.

    • @ShiveringTales-t1y
      @ShiveringTales-t1y ปีที่แล้ว

      @Lexi Henrion tô be honest I don't remember what I did lol, the client dint like the idea so I discarded

  • @fmesteban
    @fmesteban 2 ปีที่แล้ว

    OMG!! really amazing this video tutorial!!! Thanks you very much!!! =)

  • @HenshinAsset
    @HenshinAsset 3 ปีที่แล้ว +1

    Yey! I had been wondering when the next one was coming. Any word on a full tutorial packaged I mentioned before?

  • @DtavsExists
    @DtavsExists 2 ปีที่แล้ว

    your tutorials are very helpful, thanks for helping my game development process.

  • @mwsx1000
    @mwsx1000 3 ปีที่แล้ว +3

    Hi my marker is all jittery when I pick it up and it still shakes when I try to draw on the whiteboard with it. I have the lines of code for freeze rotation in place, what else could possibly be the issue?

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว +2

      Try checking the "enable smooth position/rotation" on the pen grab interactable

    • @mwsx1000
      @mwsx1000 3 ปีที่แล้ว +1

      @@JustinPBarnett thanks I’ll try that. I ended up just ditching the marker all together and made it so that it drew when your hand raycast hit the whiteboard and you were holding the trigger, made things a lot easier

    • @chiaramastino9970
      @chiaramastino9970 2 ปีที่แล้ว

      @@mwsx1000 hi I'm having your same issue.. could you help me?

    • @generichuman_
      @generichuman_ 2 ปีที่แล้ว

      I added a comment on this video that may help

  • @Wall3nd
    @Wall3nd 2 ปีที่แล้ว +3

    Hey man, thanks a lot for this!
    Could you possibly give me a quick idea on how to make the drawing only apply to the surface in front, and not to both sides of the object? (I wanted to be able to paint a 3d object, like a vase)

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      As long as your texture doesn’t repeat you’re fine and it’ll only show on the place you draw!

  • @irfanyaqoob4717
    @irfanyaqoob4717 ปีที่แล้ว

    Why my pencil passthrough the plane(page ) while writting, i am using virtual hands for grabbing the pencil and oculus integration

  • @goodmen6938
    @goodmen6938 2 ปีที่แล้ว +2

    very informative tutorial, can anybody give me a direction as to where I should look or how to go on about making a circle instead of 5x5 squares from marker

    • @everysimotv3837
      @everysimotv3837 2 ปีที่แล้ว

      did you get it?I still need help because i figured out how to do the circle but i'm having problem with setting the background color for the corners of che square that wraps the Circle

  • @iducater9882
    @iducater9882 3 ปีที่แล้ว +4

    Whenever the marker touches the board, it bounces around like crazy(it also jitters a little when I grab it), so I cannot draw it properly, any suggestion for solving the problem? Thanks.

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว +1

      There's a "smooth position/rotation" checkboxes on the grab intractable component. Check that and see if it helps

    • @chiaramastino9970
      @chiaramastino9970 2 ปีที่แล้ว +1

      @@JustinPBarnett Hi everyone that's don't really solve the problem.. Have you got any other idea? is there something to do about the physic of the pen?

    • @flashp0ke
      @flashp0ke 2 ปีที่แล้ว +1

      @@JustinPBarnett Didnt solve the problem too, maybe there can be another approach except smooth position/rotation checkboxes?

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      @@flashp0ke join the discord and we’ll help you troubleshoot!

    • @generichuman_
      @generichuman_ 2 ปีที่แล้ว +1

      I added a comment on this video that may help

  • @petrstach3399
    @petrstach3399 2 ปีที่แล้ว +1

    Another great tutorial. I was wondering how to get rid of those red pointers linked to hands and swap hands with some nice prefabs. Would it be simply add hands as prefabs to left and hands controllers ,or is it something more tricky to set up. Thanks

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Nope that's the easy way to do it! You can even set up a trigger to close/open the hands there too! To prevent the pointers from showing, just change the valid/invalid colors to transparent in the XR Line Visual

  • @0703wingyan
    @0703wingyan 2 ปีที่แล้ว

    Sorry, I got one trouble when I type the code which that I cannot find "Enumerable.Repeat". As when I put the cs folder into unity, it shown error. Can I get any help here? Thanks

  • @ajinjoseph1
    @ajinjoseph1 2 ปีที่แล้ว +4

    how to erase what is written?

  • @Krazium
    @Krazium 3 ปีที่แล้ว +2

    Thanks Justin! Just wondering if you would make a quick video just explaining how to setup Hurricane VR and Hexabody VR? I bought both and got disappointed when I realized that it wasn't so simple as clicking a button to setup😂

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว +1

      Yea! I'm planning on doing that soon

    • @neilfosteronly
      @neilfosteronly 3 ปีที่แล้ว

      Do you want to set Hurricane VR up for this or just in general? For this it seems to work. Using Hurricane VR and Final IK integrated. If having a problem setting up Hurricane VR the discord for it is great. Lots of help there and a few videos.

  • @Timedar
    @Timedar 3 ปีที่แล้ว +1

    Really nice!

  • @jsissler
    @jsissler 2 ปีที่แล้ว

    Excellent video! Any chance you can provide a reference to the classroom scene featured in the video? Looking for free assets to use to teach a college course. TIA.

  • @itslolbrine2788
    @itslolbrine2788 3 ปีที่แล้ว +2

    At the beginning of the code what is used?
    it should be like
    '''
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    '''
    and what else?

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว

      Yes that's what you start out with!

    • @nefertitimontoya
      @nefertitimontoya 2 ปีที่แล้ว

      I had to add "using System.Linq" to get enumerable to work

  • @Willibeify
    @Willibeify 3 ปีที่แล้ว +2

    Can you Write on 3D Models with These scripts or does it Need to be a 2D Plane „whiteboard“?

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว +2

      It'll work on 3D objects! You just need to make sure there are no repeating textures or else you'll draw in multiple places

    • @Willibeify
      @Willibeify 3 ปีที่แล้ว

      @@JustinPBarnett thanks ill Test it

  • @MrTakeshi763
    @MrTakeshi763 2 ปีที่แล้ว +1

    Cant get the code on the marker to work, using ms visual basic 2019 and its throwing up a bunch of errors ( enumerable/lastTouchPos/-lastTouchFrame/whitebord does not exist in the current context) should i be using a different editor for the script? Any help would be great as I’m an absolute beginner in coding

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Join the discord if you're still having issues and we can help you troubleshoot!

  • @mtalhakhalid1679
    @mtalhakhalid1679 2 ปีที่แล้ว +1

    Hello sir i somehow manage to write the code now i am having this error Assets\Scripts\WhiteboardMarker.cs(6,14): error CS0234: The type or namespace name 'Serializable' does not exist in the namespace 'System' (are you missing an assembly reference?)

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      You need to add a "using ..." statement at the top of your code!

  • @danielguerragallardo1804
    @danielguerragallardo1804 3 ปีที่แล้ว +2

    What unity version you recommend for long term vr projects?

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว

      Any that are listed as LTS (Long Term Support)!

  • @contrains1264
    @contrains1264 3 ปีที่แล้ว +1

    Could you do a video of hand animation and grab video

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว

      I have one about hand animations and another about physics grabbing!

  • @ปันจกรสุวรรณเนตร

    This tutorial bring you to performance issued at the end. but however thank you.

    • @JustinPBarnett
      @JustinPBarnett  ปีที่แล้ว

      Yea definitely not the most optimized 😅

  • @siddhanthsridhar4742
    @siddhanthsridhar4742 ปีที่แล้ว

    my marker starts rotating once it collides with the whiteboard...how to fix this

  • @parsarafieee5968
    @parsarafieee5968 2 ปีที่แล้ว +1

    bro you are amazzzing

  • @mariakristensenearvox8169
    @mariakristensenearvox8169 2 ปีที่แล้ว

    Thank you! This video was amazing! :D
    I am rather new to coding, so I hope someone in the comments will be able to help. I want to add a looping sound effect that will play whenever the marker touches the whiteboard, and stops when it is not, but I am having trouble finding the right place to apply it to the code. Any insights would be really helpful!

  • @HoaNguyen-bm3rq
    @HoaNguyen-bm3rq 5 หลายเดือนก่อน

    IS there anyone have problem with a newer unity version , i followed the instruction step by step but it didn't work

  • @crystalzhang1836
    @crystalzhang1836 3 ปีที่แล้ว +1

    Hello Justin,
    Thank you for the informative tutorials.
    Just wondering: Would it be OK if I used the tutorials' code base on your channel for a University project? I won't be receiving any commission or profit from the project.

  • @Wipsnipidy
    @Wipsnipidy ปีที่แล้ว +1

    Is there a way to be able to draw on an existing texture? I want my players to trace something but the new texture in the script just wipes it

    • @ugochukwunwankiti6030
      @ugochukwunwankiti6030 ปีที่แล้ว +1

      Were you able to solve this? I am going through the same issue

    • @Wipsnipidy
      @Wipsnipidy ปีที่แล้ว

      Sorry I did not, no :( @@ugochukwunwankiti6030

  • @AndyPonsG
    @AndyPonsG ปีที่แล้ว

    Hi! Thank you so much for the tutorial, it is very helpful. I have a question, how do you move the marker when testing the game in Unity? My object will not move..😅 Thank you!

    • @James-jv5vi
      @James-jv5vi ปีที่แล้ว

      changed to scene mode then select the mode tool then move the marker

  • @laithbarakatt6714
    @laithbarakatt6714 2 ปีที่แล้ว

    Hi Justin, i am happy your out here doing this.
    i get this error what ever i do , can you help please.
    Assets\Whiteboard\Scripts\Marker.cs(22,19): error CS0103: The name 'Enumerable' does not exist in the current context.
    thanks

    • @nefertitimontoya
      @nefertitimontoya 2 ปีที่แล้ว

      add "using System.Linq" in the imports at the top of the code

  • @PhilipHerlitz
    @PhilipHerlitz 2 ปีที่แล้ว +1

    My marker is still trying to change its rotation if i push it harder against the whiteboard. I have transform.rotation = _lastTouchRot; and _lastTouchRot = transform.rotation; . Any ideas why my marker is still trying to bend and rotate, and not stay at its current rotation?

    • @gracereilly500
      @gracereilly500 ปีที่แล้ว

      Did you figure this issue out, I am currently having the same issue thank you!!

    • @PhilipHerlitz
      @PhilipHerlitz ปีที่แล้ว

      Nope. I abandoned the project. I was working on educational projects (like virtual learning classesrooms) for a while. But now I'm working on a fun VR video game project.@@gracereilly500

  • @NickyNickell
    @NickyNickell 3 ปีที่แล้ว +1

    Can you make a tutorial for making a VR computer? (Like the Job Simulator computer)

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว

      That's a cool idea!

    • @NickyNickell
      @NickyNickell 3 ปีที่แล้ว

      @@JustinPBarnett I've been really wanting to know how to do that. I'm not sure how though

  • @Bensmithcycling
    @Bensmithcycling 2 ปีที่แล้ว

    Justin what software do you user for the image in the frame thing?

  • @MrMiracleteen55
    @MrMiracleteen55 3 ปีที่แล้ว +1

    Hey man, not sure if you read these but worth a shot. Currently trying to navigate the new XR Input system and I gotta say. It is fucking me up. It seems pretty simple to set up normal functions that are included. But trying to create unique functions seems so difficult. I am curently just trying to transfer some old code I had from a SteamVR game that used GetStateDown and GetStateUp and I have no clue how to just check for trigger pressed and trigger released on this XR input system. It is really frustrating the hell out of me.

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว

      I have a videos specific to the new input system! And you can always join the discord for a more specific technical question

  • @masterofchips123
    @masterofchips123 2 ปีที่แล้ว

    Great tutorial

  • @broke8246
    @broke8246 3 ปีที่แล้ว +1

    Open Xr crashes my project EVERYTIME, tried on multiple different versions too, any clue why??

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว

      Huh that's odd. Make sure your packages are updated. They recently updated to a new version

  • @contrains1264
    @contrains1264 3 ปีที่แล้ว +1

    When you did hand controller animation code it didn't work for me I didn't see the things on your c# show up

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว +1

      There wasn't any hand controller animation code in this tutorial

    • @contrains1264
      @contrains1264 3 ปีที่แล้ว

      When you did the starting a vr game video with hand animation

  • @104nimrahkhan8
    @104nimrahkhan8 ปีที่แล้ว +1

    Please upload one, how to use ML in unity

    • @JustinPBarnett
      @JustinPBarnett  ปีที่แล้ว

      Oh that's a huge topic 😳 not quite my niche yet

  • @ansokan1920
    @ansokan1920 2 ปีที่แล้ว +1

    Hi Justin can i make this without VR set up ?

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      Sure! The concepts would apply to a 2D/3D game. Just the interactions are different in VR

  • @kensabu2064
    @kensabu2064 7 หลายเดือนก่อน

    Thanks man❤❤

  • @songonyou
    @songonyou 2 ปีที่แล้ว +1

    Hi! thank you for your great tutorial. But, unfortunately, I can only draw a diagonal, straight line with the marker. Does anyone have a same problem like me? I follow the exact same script what Justin wrote, but can't draw it properly.

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      Join the discord if you're still having issues and we can help you troubleshoot!

  • @rizzierifedrigo6066
    @rizzierifedrigo6066 3 ปีที่แล้ว +1

    The WhiteboardMarker script gave me an error, because there's a type or namespace called "Whiteboard"(it is when we call all the variables)

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว

      Did you by chance rename the script and forget to change the class name?

    • @KevinSizemore
      @KevinSizemore 2 ปีที่แล้ว

      I had that same problem...it was because I had different capitalization on the name of the WhiteBoard.cs .... and followed Justin's code with the 'B' in Whiteboard being lower case.

  • @Itama22
    @Itama22 2 ปีที่แล้ว +1

    Hey Justin, this is working great for me, thanks a lot!
    I still have a weird issue though, maybe it's a quick fix:
    On my Markers Tip, when I try to draw something on the whiteboard, only one edge of the tip can actually draw, the others won't do anything.
    Kinda hard to explain, it's like it can only draw with the bottom side of the tip.
    The one edge on the tip, that is working also slightly clips into the whiteboard - the other edges don't do that.
    I did try to adjust the colliders on the tip, but it didn't help. ^^

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      Join the discord if you're still having issues and we can help you troubleshoot!

    • @sneakyfox03
      @sneakyfox03 2 ปีที่แล้ว

      On the line 'if (Physics.Raycast(_tip.transform.position, transform.up, out _touch, _tipHeight))', try change the 'transform.up' to 'transform.forward' or 'transform.right' (or rotate the tip)

    • @Itama22
      @Itama22 2 ปีที่แล้ว

      @@sneakyfox03 I will try it, thank you :)

    • @Itama22
      @Itama22 2 ปีที่แล้ว

      @@sneakyfox03 It took me a while but I finally implemented your fix and yeah you're right. The problem was that my marker was rotated and that lead to problems with the actual drawing so I could fix it by just rotating the marker! :D
      Thank you :)

    • @mattdway
      @mattdway ปีที่แล้ว

      @@sneakyfox03 Just wanted to say thanks. This helped resolve my issue with the marker not drawing except when a specific corner was touching the whiteboard too!

  • @sumomafia
    @sumomafia 2 ปีที่แล้ว +1

    the rotation lock doesnt seem to work. any idea why ?

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      Join the Discord and we can help you troubleshoot!

  • @maokruDev
    @maokruDev ปีที่แล้ว

    Bro! Did you made the script for the eraser? It would be super healpfull for my vr project! So i would really aprecciate a tutorial c: ,Thanks!

  • @KING4COKE
    @KING4COKE 2 ปีที่แล้ว +1

    Anybody else has the problem that this just works in the Unity Editor Play mode, but when you build the project the marker just doesnt work?

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      Yea I've heard that mentioned a few times now... join the discord if you can't figure it out and we can help you troubleshoot

    • @khaledelwaseif9819
      @khaledelwaseif9819 2 ปีที่แล้ว

      yes i am
      did you solve it

  • @axelsmaxel
    @axelsmaxel 2 ปีที่แล้ว

    My pen is detecting the wall too soon, and draw before i even touch the whiteboard, and yes I checked the colliders... any help???

    • @wufners
      @wufners ปีที่แล้ว

      I ran into this issue too. In my case, it was because I was using my own marker model which threw things off.
      The pen drawing before touching the whiteboard was due to the ray cast being longer than the model's tip height.
      The length of the ray cast is set by the length of the tip in this line:
      _tipHeight = _tip.localScale.y;
      This works in the tutorial because Justin created the maker tip from a 1x1x1 cube and then scaled it down to 0.05. So when the script is grabbing the local scale, it creates a ray cast that's only 0.05 meters/units long.
      I modeled my own marker and then froze all the transforms, so my local scale was 1. This meant that the ray cast was being thrown a full meter in front of the marker. Oops.
      To fix this, the _tipHeight needs to equal the actual size of the tip.
      Which you can do by either hard coding in the length of the tip, if you know it (or stumble on it by trial and error). In my case, that would have been:
      _tipHeight = 0.012f;
      Or better yet, use the mesh collider on the tip to get the length:
      _tipHeight = _tip.GetComponent().bounds.size.y;
      Since my pivot was in the center rather than the bottom of the tip, this still cast a little too far in front. To compensate, divide by 2 to get the distance from the center to front edge of the tip:
      _tipHeight = _tip.GetComponent().bounds.size.y / 2;
      That did it for me. Don't know how much help it is to you 9 months later, but there it is.
      And thank you Justin for this and all of your other great tutorial! Much appreciated!

    • @axelsmaxel
      @axelsmaxel ปีที่แล้ว

      I aint reading allat but thanks

  • @MidgetTea2
    @MidgetTea2 3 ปีที่แล้ว +1

    Can You make how To Make a gun which shoots?

  • @nikhilchoubey2676
    @nikhilchoubey2676 ปีที่แล้ว

    How can I use it in a multiplayer game?

    • @JustinPBarnett
      @JustinPBarnett  ปีที่แล้ว

      All you really need to do is sync the markers. Then the whiteboard texture should update locally based on marker position no matter who's writing.

  • @contrains1264
    @contrains1264 3 ปีที่แล้ว +1

    Could you put the code on your patreon

    • @JustinPBarnett
      @JustinPBarnett  3 ปีที่แล้ว

      It's there! Here's the link if you need it: www.patreon.com/justinpbarnett

  •  2 ปีที่แล้ว

    ERROR CS1501, SetPixels, HELPP

  • @mtalhakhalid1679
    @mtalhakhalid1679 2 ปีที่แล้ว +1

    you should addd code in description as well its a good practice

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      The code is available!

    • @mtalhakhalid1679
      @mtalhakhalid1679 2 ปีที่แล้ว

      @@JustinPBarnett sorry i didn't find it where is can you send me link

    • @mtalhakhalid1679
      @mtalhakhalid1679 2 ปีที่แล้ว +2

      @@JustinPBarnett Ever since Half Life: Alyx, I KNOW you've imagined playing around with a whiteboard in your games. Well today is the day! In this tutorial I'll show you how to set up whiteboards and markers using Unity VR. (This will work for any Unity VR framework too!)
      // 🦸‍♀️ GET THE SOURCE PROJECT (by supporting me on Patreon!)
      www.patreon.com/posts/58770028
      // 👋 JOIN THE DISCORD
      discord.gg/6mzMQx5VKk
      // 📺 WATCH NEXT
      How to Make a VR Game: th-cam.com/video/yxMzAw2Sg5w/w-d-xo.html
      How to Become a VR Developer: th-cam.com/video/oqXBY51KP5A/w-d-xo.html
      How to Set Up your Oculus Quest 2: th-cam.com/video/yvtSvMECgbw/w-d-xo.html
      How to Use Unity's New Input System: th-cam.com/video/SAij67HrgAM/w-d-xo.html
      How to Set Up Procedural Inverse Kinematics: th-cam.com/video/MYOjQICbd8I/w-d-xo.html
      // 🛠 MY FAVORITE UNITY VR ASSETS
      Best All-Around VR Framework: assetstore.unity.com/packages...
      Best Procedural Hands: assetstore.unity.com/packages...
      Best Player Controller for VR: assetstore.unity.com/packages...
      Best VR Hand Models: assetstore.unity.com/packages...
      Best UI for VR: assetstore.unity.com/packages...
      // 🥽 MY VR HEADSETS
      Oculus Quest 2: www.oculus.com/referrals/link...
      Valve Index: store.steampowered.com/valvei...
      HP Reverb G2 Omnicept Edition: www.hp.com/us-en/vr/reverb-vr...
      // 🎥 VIDEO GEAR USED
      Camera: amzn.to/38V2N8f
      Light: amzn.to/38Wwvd0
      Mic: amzn.to/3sCq7Q4
      🔔 And make sure you subscribe to my channel!
      th-cam.com/users/JustinPBarn...
      DISCLAIMER: Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide I may receive a small commission. There is no additional charge to you! Thank you for supporting me so I can continue to provide you with free content each week!
      Sharing VR tips to help you create that Virtual Reality game faster than you thought possible!

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      @@mtalhakhalid1679 All the code is written out in the video for you to copy yourself, but if you would rather just download the source project you can get it here! www.patreon.com/posts/58770028

  • @clumsyranger2914
    @clumsyranger2914 2 ปีที่แล้ว +1

    Enumerable isnt working in the code

    • @axelsmaxel
      @axelsmaxel 2 ปีที่แล้ว

      Just add "using System.Linq;" to the top of the script :D

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      👆

  • @MegaTechno
    @MegaTechno 3 ปีที่แล้ว +1

    I am from Vr super jam. I created veat sager

  • @PaulRobello
    @PaulRobello ปีที่แล้ว

    Great tut! I changed the raycast a bit to allow the full height of the tip to be used to draw, otherwise inserting the tip past the midpoint would not result in a raycast hit: Physics.Raycast(_tip.position - transform.up * _tipHeight, transform.up, out _touch, _tipHeight * 2);

  • @mb_birddog9243
    @mb_birddog9243 2 ปีที่แล้ว

    Hey what do you do when it says "Enumerable" doesn't exist

    • @PrzemekPol
      @PrzemekPol 2 ปีที่แล้ว

      using System.Linq

  • @lordstair1359
    @lordstair1359 2 ปีที่แล้ว

    Is there a way to pre-draw something on the whiteboard that appears every time you load the game?

  • @kelleyintegritysafetysolut484
    @kelleyintegritysafetysolut484 2 ปีที่แล้ว

    the marker script has some incompatible code if written in visual studio. I am unable to do Enumerable.repeat, so i tried IEnumerable.repeat, but repeat won't work because there is no contained definition for repeat, apparently.

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Huh, that's a C# thing not a visual studio thing so it should work regardless of editor

    • @kelleyintegritysafetysolut484
      @kelleyintegritysafetysolut484 2 ปีที่แล้ว +1

      @@JustinPBarnett I found the answer on your Discord server. Thanks for the great tutorials.

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      @@kelleyintegritysafetysolut484 awesome!

    • @kelleyintegritysafetysolut484
      @kelleyintegritysafetysolut484 2 ปีที่แล้ว

      @@JustinPBarnett I'll be supporting you over on your Patreon within the next few days. Thanks a million.

    • @nefertitimontoya
      @nefertitimontoya 2 ปีที่แล้ว +1

      "using System.Linq"

  • @lordstair1359
    @lordstair1359 2 ปีที่แล้ว

    Using ( _whiteboard.texture.Apply(); ) is very expensive and causes my 200FPS scene to drop down to 28FPS. Really bad for VR! Are there better methods to get the same result?

    • @dirtyleon
      @dirtyleon ปีที่แล้ว

      I'm having the same issue right now. Have you found a solution or alternative methods yet?