How to Slice in VR - Unity XR Tutorial

Поділитися
Вставка
  • Опубліковано 11 вер 2024
  • Slicing objects must be one of the most satisfying mechanisms in VR, so let's find out how we can do this in Unity !
    ❤️ Support on Patreon : / valemvr
    🔔 Subscribe for more Unity Tutorials : www.youtube.co...
    🌍 Discord : / discord
    🐦Twitter : va...
    👍 Main Channel : / @valemvr
    🔥 Tiktok : / valemxr
    FRUIT NINJA VR Tutorial : / exclusive-making-48123550
    Ezy-Slice : github.com/Dav...
    VelocityEstimator : drive.google.c...
    ····················································································
    📝Best VR Assets ( These links are Affiliate links which means it costs the same to you and I get a small commission. Thanks for your support!)
    VR Interaction Framework
    assetstore.uni...
    Hexabody (Physics VR Player)
    assetstore.uni...
    Mirror and Reflection for VR
    assetstore.uni...
    Auto Hand (automatic hand grab pose)
    assetstore.uni...
    Hurricane VR (vr physics interaction)
    assetstore.uni...
    3d Hand Model for VR
    assetstore.uni...
    ····················································································
    Full Series on How to make a VR game • How to Make a VR Game ...
    ····················································································
    If you enjoyed this video, here are some other really good channel you should appreciate :
    ⌨️ Game Dev
    Brackeys : / @brackeys
    Dani : / @danidev
    Code Monkey : / @codemonkeyunity
    👨‍🎓 Vr Dev
    Justin P Barnett : / @justinpbarnett
    Vr with Andrew : / @vrwithandrew
    ····················································································
    #vr #vrdev #madewithunity

КОМЕНТАРІ • 82

  • @ValemTutorials
    @ValemTutorials  Рік тому +15

    Guys I forgot to talk about something important ! You can of course slice the object again after they are sliced ! Simply set the layer of the new sliced object to the sliceable layer we've created ! :D

    • @Headfelt
      @Headfelt Рік тому +2

      fyi slicedObject.layer = LayerMask.NameToLayer("Sliceable");

    • @weirdtheory
      @weirdtheory Рік тому

      @@Headfelt in wich scrip should I put it in and where?

    • @Bayonora
      @Bayonora Рік тому +1

      You could explain a way to cut if the sword is at a specific speed so you dont cut anything just with a touch

    • @shabu8288
      @shabu8288 Рік тому +1

      GameObject upperHull = hull.CreateUpperHull(target, crossSectionMaterial);
      SetupSlicedComponent(upperHull);
      upperHull.layer = target.layer;
      GameObject lowerHull = hull.CreateLowerHull(target, crossSectionMaterial);
      SetupSlicedComponent(lowerHull);
      lowerHull.layer = target.layer;
      this is how to enable it

    • @rexgreenwood7372
      @rexgreenwood7372 Рік тому

      Source code man

  • @venusroc1258
    @venusroc1258 Рік тому +11

    I personally think that this kind of creative and immersive solution tutorials or optimization for vr are better. Because mostly thanks to you Valem we got lots of tutorials covering the basic systems. But not enough like this one. Much appreciated thanks

  • @TheBroph
    @TheBroph Рік тому +8

    bro this is a cutting edge tutorial

  • @HipBlooD
    @HipBlooD Рік тому +8

    Really the best VR teacher of youtube. I don‘t know how but you really made me understand enough with your videos that i can now proudly say that my first game is near to the beta-test phase. Thank you Valem, with the beginning of next month, you‘ve got a new patreon! greetings from germany 🤘🏼

    • @ValemTutorials
      @ValemTutorials  Рік тому

      Dankeschone Diavolo ! :D I'm glad I was able to help and feel free to link me your game once ready. :)

  • @SpaceRex
    @SpaceRex Рік тому +4

    "Wake up babe! A new Valem tutorial just dropped."

  • @the_unreality
    @the_unreality Рік тому +4

    Tu es la raison pourquoi je suis tellement motivé dans le dévelopemment de jeux VR sur Unity. Très bonne vidéo comme d'habitude, continue comme ça :)

    • @ValemTutorials
      @ValemTutorials  Рік тому +2

      et c'est des messages comme le tien qui me motive a continuer de faire des tutos merci à toi ! :)

    • @hikariminami2960
      @hikariminami2960 8 місяців тому

      Ah c'est pour ça cet accent Français, je me disais bien que ça sentait familier XDDD@@ValemTutorials

    • @hikariminami2960
      @hikariminami2960 8 місяців тому

      super tutoriel, merci !@@ValemTutorials

  • @amiibojeremiah809
    @amiibojeremiah809 Рік тому +2

    for those that can't get it to work with mesh you have to enable read write on the mesh in the assets

    • @LeoJTNT
      @LeoJTNT Рік тому

      I have it on but still is not working

  • @HuJohner
    @HuJohner Рік тому +1

    Haha I am working with EzySlice as well at the moment! Currently trying to make slicing colliders as well as mesh colliders are not great especially if the object has multiple different physics materials but one mesh.

  • @jagdishsahu3935
    @jagdishsahu3935 Рік тому

    I was currently making a beat saber clone so.. the timing of this tutorial is so perfect for me!! THANK YOU SO SO MUCH!! 💙💙💚💚❤❤💛💛

  • @st8tix
    @st8tix Рік тому

    Was looking for a good slicing tutorial for a while so you saved me. Thanks!

  • @queenawzq
    @queenawzq 6 місяців тому

    Thanks so much for the detailed tutorial, very helpful!

  • @josteinschefte-jg6mx
    @josteinschefte-jg6mx Рік тому

    You're an absolute legend! Thank you for another great video!

    • @ValemTutorials
      @ValemTutorials  Рік тому +1

      I'm glad I was able to help and thank you for another donation Jostein you're the best

  • @A_walk_in_the_park
    @A_walk_in_the_park Рік тому

    finally someone !! Thank you sooo much!!!

  • @THE_ONLY_GOD
    @THE_ONLY_GOD Рік тому

    Wow, that valve code looks fancy. I used simply 2 positions with time.deltatime before.

  • @MrMaclovin
    @MrMaclovin Рік тому +2

    Like if you agree the best part of this video is hearing Quentin say “upper hull”

  • @alvarovalencia2859
    @alvarovalencia2859 5 місяців тому

    really nice tutorial, thank you, the only problem i had its if u let the slicer objct inside the mesh it cuts infinetely. But really nice toturial man

  • @vrfxrealtime
    @vrfxrealtime Рік тому

    Amazing, thanks for sharing!

  • @IsotronicGames
    @IsotronicGames Рік тому +5

    Hi, thank you so much
    when child objects are sliced the new objects will appear far from the father
    there is the fix:
    on SlicedHull script
    newObject.transform.localPosition = original.transform.position;

    • @Lemon-dh4fz
      @Lemon-dh4fz 6 місяців тому

      OH GOD. THANKS YOU. Valem should pin this comment

    • @DrDrastic624
      @DrDrastic624 27 днів тому

      what do you mean by newObject and original? i dont have that and also where does this go. sorry i know this is a late comment im having this issue where my sliceable is a child cause of the fruit model i downloaded and when i slice the pieces go FLYING

  • @tomcruise1387
    @tomcruise1387 Рік тому +1

    Thanks, ezy slice is still through all thoses years a great tool but what do you use to slice skinnedmesh renderers ?

  • @atifmeit
    @atifmeit 8 місяців тому

    Valem, Your vids are amazing! Thank you! Any suggestions on slicing children on the gameobject? Array, List, Loop or would it be too processor intensive?

  • @nimamasila
    @nimamasila 3 місяці тому

    Praise the Sun!

  • @bignekidbatzero
    @bignekidbatzero 8 місяців тому +1

    4:04 what's a lover hull? jk lol

  • @rag1014
    @rag1014 3 місяці тому

    Nice video and I was wondering how do I play my unity vr game on my oculus vr quest 2?

  • @Pro-xm8jb
    @Pro-xm8jb Рік тому +1

    Can i slice animated objects?

  • @andypang1010
    @andypang1010 4 місяці тому

    I have the slicing mechanic working perfectly but Unity is giving me errors about "Couldn't create a Convex Mesh from source mesh within the maximum polygons limit (256). The partial hull will be used. Consider simplifying your mesh". The gameObjects I have in the scene that I am cutting is only one capsule so I am not really understanding why that's happening. Sometimes after cutting, the hulls will also mysteriously disappear, so I'm really unsure what's wrong here. Can anyone help?

  • @mohankrishna9183
    @mohankrishna9183 Рік тому

    Hey valem ur tutorials are all amazing this cut is amazing try to make a tutorial of a soft mesh cut ,
    Thankyou

    • @ValemTutorials
      @ValemTutorials  Рік тому

      Thanks Mohan ! :D But what's a soft mesh cut ?

    • @mohankrishna9183
      @mohankrishna9183 Рік тому

      @@ValemTutorials exactly like a surgical cut like how a surgeon cuts the skin during a surgery

    • @FeTetra
      @FeTetra Рік тому

      is that even possible

  • @HalloGaming
    @HalloGaming Рік тому

    I remember doing something like that in VR but it came packaged with a lot of warnings lol

  • @GamerReality
    @GamerReality Рік тому +1

    What about poking a hole through an object?

    • @ValemTutorials
      @ValemTutorials  Рік тому +1

      Poking hole using mesh will be really computer heavy unfortunately. :/ But you can use stencil shader to create a "hole" mask and have something similar very easily. :) I made a mirror tutorial using stencil that used this technique.

  • @Seki-fi4vt
    @Seki-fi4vt Рік тому

    Nice tutorial, do you have any ideas about curve slicing in VR?

    • @ValemTutorials
      @ValemTutorials  Рік тому

      Curve slice might be hard because the procedural generation is not obvious with a curve :/ maybe youi can fake it by creating the curve using multiple linear curve

  • @user-fn9dy8dn8n
    @user-fn9dy8dn8n Рік тому

    Hi Valem ! Could you do an update tutorial on the Pico4, especially for those who want to develop a PCVR game and have a Pico4 as hardware. Or do you have an idea on what should be the path to follow to achieve such thing ? I dont' want to make an apk build because it will not be playable by those who have a Rift S for example.
    Thanks!

  • @vinaykrishnasharma5024
    @vinaykrishnasharma5024 Рік тому

    The slice method is cutting through infinitely, not as per the size/scale of cutting plane, is there a way to limit the size of the cutting plane or control its limits so that only the part of a mesh that cuts through the plane (exact size of the cutting plane) gets cut instead of parts of the mesh cutting through the cutting plane as it is infinitely scaled. I am trying to cut through single mesh of a small city with some buildings, but the slice method is cutting though all the buildings which are above the cutting plane height instead of just cutting through the single building which is intersecting with the actual cutting plane.

  • @Beno951
    @Beno951 Рік тому

    loverHull is indeed very lovely 😄

    • @ValemTutorials
      @ValemTutorials  Рік тому

      man I had so much trouble trying to say that word :D

  • @crampribYT
    @crampribYT Рік тому

    I have a problem. When I swing too fast sometimes it just go through cube without cutting it. Any idea how can I fix that?

  • @FeTetra
    @FeTetra Рік тому

    you killed the homie suzanne

  • @pitaman_ld
    @pitaman_ld Рік тому

    Can you make a video con continous movement? I have trouble making it work. I uncheck snap turn and I still cant continuously turn. In fact I cant turn at all.

  • @The_T-Bone
    @The_T-Bone 11 місяців тому +1

    Can you double cut objects?

    • @ValemTutorials
      @ValemTutorials  11 місяців тому +1

      Yes just give the sliceable component to the spawned object and you can cut them again

    • @The_T-Bone
      @The_T-Bone 11 місяців тому +1

      Thank you so much!@@ValemTutorials

  • @rahmatriyadi3201
    @rahmatriyadi3201 Рік тому +1

    how to add xr grab interactable to upper hall and lower hall so ican grab that?

    • @leurcutis
      @leurcutis 6 місяців тому +1

      Add "using UnityEngine.XR.Interaction.Toolkit; to the header. Then, in the SetUpSlicedComponent function, add a line under the MeshCollider line: "XRGrabInteractable grabbable = slicedObject.AddComponent(); ->this should allow you to grab onto any of the hulls after they've been sliced. -- of course this will only work if you are either not using the layer mask, or if you make it possible to grab things on the "Sliceable" layer. If you've used the Direct Interactor Prefab in the controllers (for direct interactions), then select that and add both the "sliceable" and "default" layers to the Physics Interaction Mask list.

  • @matthewduncanson8744
    @matthewduncanson8744 Рік тому

    could you please do a tutorial on melee combati vr?

  • @akmk9091
    @akmk9091 6 місяців тому

    Will this work for 3D humanoid models?

  • @illiakniaziev2126
    @illiakniaziev2126 9 місяців тому

    Hello, i have a problem, with static objects that i add everything works great, but if i want to slice animated object with the same properties and added componet this ist work at all, maybe you know how to set it up properly ?

    • @Shadow-lo4dt
      @Shadow-lo4dt 6 місяців тому

      Have you found the answer to your question

  • @showerthoughsshorts
    @showerthoughsshorts 11 місяців тому

    i have a problem i cannot interact with sliceable object using the XR grab intractable i set my controllers to the sliceable layer and it did not help anyone know any fixes?

    • @BCABPP
      @BCABPP 10 місяців тому

      same - no errors - everything on the sliceable layer but nothing gets cut when I use my XR Grabbable. Did you ever figure out the issue? ChatGPT didn't see any errors either.

  • @ondrejeder8816
    @ondrejeder8816 Рік тому

    How compute heavy is this ? Would it work okay on Quest 2 ? Thanks for the tutorial btw

    • @ValemTutorials
      @ValemTutorials  Рік тому +1

      I should have talk about it in the video, but this is really based on the mesh complexity, if you're slicing boxes like in beat saber no worries on quest 2 but with thousand of triangles this can get worse as there is procedural mesh involved. :)

  • @JoskeVR
    @JoskeVR Рік тому

    idk why but it isn't slicing for me, no errors at all so I dont get it. It's just a cube I'm trying to slice nothing special

    • @Xever2x
      @Xever2x 8 місяців тому

      i also have this issue. the hasHit variable is never true in my case, so it never calls the slice method, did you find a fix?

    • @Xever2x
      @Xever2x 8 місяців тому

      apparently the linecast was too deep inside the collider of the cutting object, so it could never touch the slicable one.

  • @papayawboakye-akyeampong3935

    you sound like brackeys

  • @kelmas13
    @kelmas13 Рік тому

    MM

  • @beardordie5308
    @beardordie5308 Рік тому

    Cut it out, man

    • @beardordie5308
      @beardordie5308 Рік тому

      This video is super choppy

    • @ValemTutorials
      @ValemTutorials  Рік тому +1

      @@beardordie5308 Yeah but I'm glad this video made the cut. :D

  • @THE_ONLY_GOD
    @THE_ONLY_GOD Рік тому

    Wow... he sliced right through that illegal immigrant from africa...

  • @mrpgumusic
    @mrpgumusic Рік тому +1

    Time to make metal gear rising VR.
    Oh wait how do I rip the assets...