How to Slice in VR - Unity XR Tutorial

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

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

  • @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 ปีที่แล้ว +2

      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

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

    This guy is a genius

  • @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. :)

  • @TheBroph
    @TheBroph ปีที่แล้ว +9

    bro this is a cutting edge tutorial

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

      Thanks I hope it slice up a good time :D

  • @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

  • @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 11 หลายเดือนก่อน

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

    • @hikariminami2960
      @hikariminami2960 11 หลายเดือนก่อน

      super tutoriel, merci !@@ValemTutorials

  • @queenawzq
    @queenawzq 9 หลายเดือนก่อน

    Thanks so much for the detailed tutorial, very helpful!

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

    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

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

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

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

    finally someone !! Thank you sooo much!!!

  • @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.

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

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

  • @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!! 💙💙💚💚❤❤💛💛

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

    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!

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

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

  • @atifmeit
    @atifmeit 11 หลายเดือนก่อน

    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?

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

    thanku

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

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

  • @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 9 หลายเดือนก่อน

      OH GOD. THANKS YOU. Valem should pin this comment

    • @DrDrasticVR
      @DrDrasticVR 3 หลายเดือนก่อน

      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

  • @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

  • @rag1014
    @rag1014 5 หลายเดือนก่อน

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

  • @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

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

    Can i slice animated objects?

  • @nimamasila
    @nimamasila 5 หลายเดือนก่อน

    Praise the Sun!

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

    loverHull is indeed very lovely 😄

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

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

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

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

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

    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!

  • @akmk9091
    @akmk9091 9 หลายเดือนก่อน

    Will this work for 3D humanoid models?

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

    could you please do a tutorial on melee combati vr?

  • @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.

  • @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.

  • @The_T-Bone
    @The_T-Bone ปีที่แล้ว +1

    Can you double cut objects?

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

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

    • @The_T-Bone
      @The_T-Bone ปีที่แล้ว +1

      Thank you so much!@@ValemTutorials

  • @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.

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

    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?

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

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

    • @leurcutis
      @leurcutis 9 หลายเดือนก่อน +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.

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

    you killed the homie suzanne

  • @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?

  • @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. :)

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

    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 8 หลายเดือนก่อน

      Have you found the answer to your question

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

    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 ปีที่แล้ว

      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.

  • @bignekidbatzero
    @bignekidbatzero 11 หลายเดือนก่อน +1

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

  • @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 11 หลายเดือนก่อน

      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 11 หลายเดือนก่อน

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

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

    MM

  • @HarelRubin
    @HarelRubin 2 หลายเดือนก่อน

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.InputSystem;
    using EzySlice;
    public class sliceObject : MonoBehaviour
    {
    public Transform startSlicePoint;
    public Transform endSlicePoint;
    public LayerMask sliceableLayer;
    public VelocityEstimator velocityEstimator;
    public Material croosSectionMaterial;
    public float cutForce = 200;
    // Start is called before the first frame update
    void Start()
    {

    }
    // Update is called once per frame
    void FixedUpdate()
    {
    bool hasHit = Physics.Linecast(startSlicePoint.position, endSlicePoint.position, out RaycastHit hit, sliceableLayer);
    if(hasHit)
    {
    GameObject target = hit.transform.gameObject;
    Slice(target);
    }
    }
    public void Slice(GameObject target)
    {
    Vector3 velocity = velocityEstimator.GetVelocityEstimate();
    Vector3 planeNormal = Vector3.Cross(endSlicePoint.position - startSlicePoint.position, velocity);
    planeNormal.Normalize();
    SlicedHull hull = target.Slice(endSlicePoint.position, planeNormal);
    if(hull != null)
    {
    GameObject upperHull = hull.CreateUpperHull(target, croosSectionMaterial);
    SetupSlicedComponent(upperHull);
    GameObject loverHull = hull.CreateLowerHull(target, croosSectionMaterial);
    SetupSlicedComponent(loverHull);
    Destroy(target);
    }
    }
    public void SetupSlicedComponent(GameObject sliceObject)
    {
    Rigidbody rb = sliceObject.AddComponent();
    MeshCollider collider = sliceObject.AddComponent();
    collider.convex = true;
    rb.AddExplosionForce(cutForce, sliceObject.transform.position, 1);
    }
    }
    thank me later😀

    • @T3RI-GAMES
      @T3RI-GAMES 2 หลายเดือนก่อน +1

      Thanks❤‍🔥🙏

  • @papayawboakye-akyeampong3935
    @papayawboakye-akyeampong3935 ปีที่แล้ว

    you sound like brackeys

  • @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...