How to Slice in VR - Unity XR Tutorial

  Рет қаралды 29,863

Valem Tutorials

Valem Tutorials

Күн бұрын

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

Пікірлер: 89
@ValemTutorials
@ValemTutorials Жыл бұрын
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 Жыл бұрын
fyi slicedObject.layer = LayerMask.NameToLayer("Sliceable");
@weirdtheory
@weirdtheory Жыл бұрын
@@Headfelt in wich scrip should I put it in and where?
@Bayonora
@Bayonora Жыл бұрын
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 Жыл бұрын
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
@vahorgan
@vahorgan 16 күн бұрын
upper HULL lower HULL haha love it. Thanks for Valem's great tutorial as always.
@venusroc1258
@venusroc1258 Жыл бұрын
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
@HipBlooD
@HipBlooD Жыл бұрын
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 Жыл бұрын
"Wake up babe! A new Valem tutorial just dropped."
@TheBroph
@TheBroph Жыл бұрын
bro this is a cutting edge tutorial
@ValemTutorials
@ValemTutorials Жыл бұрын
Thanks I hope it slice up a good time :D
@the_unreality
@the_unreality Жыл бұрын
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 Жыл бұрын
et c'est des messages comme le tien qui me motive a continuer de faire des tutos merci à toi ! :)
@hikariminami2960
@hikariminami2960 Жыл бұрын
Ah c'est pour ça cet accent Français, je me disais bien que ça sentait familier XDDD@@ValemTutorials
@hikariminami2960
@hikariminami2960 Жыл бұрын
super tutoriel, merci !@@ValemTutorials
@josteinschefte-jg6mx
@josteinschefte-jg6mx Жыл бұрын
You're an absolute legend! Thank you for another great video!
@ValemTutorials
@ValemTutorials Жыл бұрын
I'm glad I was able to help and thank you for another donation Jostein you're the best
@queenawzq
@queenawzq 11 ай бұрын
Thanks so much for the detailed tutorial, very helpful!
@itsJDarts
@itsJDarts 3 ай бұрын
This guy is a genius
@st8tix
@st8tix Жыл бұрын
Was looking for a good slicing tutorial for a while so you saved me. Thanks!
@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!! 💙💙💚💚❤❤💛💛
@A_walk_in_the_park
@A_walk_in_the_park Жыл бұрын
finally someone !! Thank you sooo much!!!
@amiibojeremiah809
@amiibojeremiah809 Жыл бұрын
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 Жыл бұрын
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.
@vrfxrealtime
@vrfxrealtime Жыл бұрын
Amazing, thanks for sharing!
@alvarovalencia2859
@alvarovalencia2859 10 ай бұрын
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
@MrMaclovin
@MrMaclovin Жыл бұрын
Like if you agree the best part of this video is hearing Quentin say “upper hull”
@IsotronicGames
@IsotronicGames Жыл бұрын
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 11 ай бұрын
OH GOD. THANKS YOU. Valem should pin this comment
@DrDrasticVR
@DrDrasticVR 5 ай бұрын
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
@atifmeit
@atifmeit Жыл бұрын
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?
@tomcruise1387
@tomcruise1387 Жыл бұрын
Thanks, ezy slice is still through all thoses years a great tool but what do you use to slice skinnedmesh renderers ?
@harharrr9810
@harharrr9810 3 ай бұрын
thanku
@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
@Waszzup
@Waszzup Жыл бұрын
Can i slice animated objects?
@rag1014
@rag1014 8 ай бұрын
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
@Beno951
@Beno951 Жыл бұрын
loverHull is indeed very lovely 😄
@ValemTutorials
@ValemTutorials Жыл бұрын
man I had so much trouble trying to say that word :D
@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.
@nimamasila
@nimamasila 8 ай бұрын
Praise the Sun!
@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!
@matthewduncanson8744
@matthewduncanson8744 Жыл бұрын
could you please do a tutorial on melee combati vr?
@akmk9091
@akmk9091 11 ай бұрын
Will this work for 3D humanoid models?
@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 9 ай бұрын
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?
@GamerReality
@GamerReality Жыл бұрын
What about poking a hole through an object?
@ValemTutorials
@ValemTutorials Жыл бұрын
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.
@Grace_RR
@Grace_RR Жыл бұрын
how to add xr grab interactable to upper hall and lower hall so ican grab that?
@leurcutis
@leurcutis 11 ай бұрын
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.
@The_T-Bone
@The_T-Bone Жыл бұрын
Can you double cut objects?
@ValemTutorials
@ValemTutorials Жыл бұрын
Yes just give the sliceable component to the spawned object and you can cut them again
@The_T-Bone
@The_T-Bone Жыл бұрын
Thank you so much!@@ValemTutorials
@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 Жыл бұрын
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 11 ай бұрын
Have you found the answer to your question
@easybuildtech
@easybuildtech Жыл бұрын
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.
@FeTetra
@FeTetra Жыл бұрын
you killed the homie suzanne
@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 Жыл бұрын
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 Жыл бұрын
apparently the linecast was too deep inside the collider of the cutting object, so it could never touch the slicable one.
@HarelRubin
@HarelRubin 4 ай бұрын
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 4 ай бұрын
Thanks❤‍🔥🙏
@bignekidbatzero
@bignekidbatzero Жыл бұрын
4:04 what's a lover hull? jk lol
@papayawboakye-akyeampong3935
@papayawboakye-akyeampong3935 Жыл бұрын
you sound like brackeys
@kelmas13
@kelmas13 Жыл бұрын
MM
@beardordie5308
@beardordie5308 Жыл бұрын
Cut it out, man
@beardordie5308
@beardordie5308 Жыл бұрын
This video is super choppy
@ValemTutorials
@ValemTutorials Жыл бұрын
@@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 Жыл бұрын
Time to make metal gear rising VR. Oh wait how do I rip the assets...
Can AI code Beat Saber ? Watch ChatGPT try
8:40
Valem
Рет қаралды 110 М.
How To Slice Meshes In Unity
4:43
Tvtig
Рет қаралды 92 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Making a Game About Weak Points
21:27
Emis
Рет қаралды 1,1 МЛН
How To Recenter in VR - Unity Tutorial
11:27
Valem Tutorials
Рет қаралды 16 М.
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 7 МЛН
The New XR Interaction Toolkit Example Project
12:09
Valem Tutorials
Рет қаралды 70 М.
I Coded Minecraft Features Nobody Asked For...
28:58
Knarfy
Рет қаралды 662 М.
SLICE objects, CUT doors or BREAK them inside Unity!
6:11
Code Monkey
Рет қаралды 65 М.
VR Optimization and Performance Tips for Unity
14:22
VR with Andrew
Рет қаралды 53 М.
This Is A Game About Digging A Hole
15:45
DangerouslyFunny
Рет қаралды 316 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН