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
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
fyi slicedObject.layer = LayerMask.NameToLayer("Sliceable");
@@Headfelt in wich scrip should I put it in and where?
You could explain a way to cut if the sword is at a specific speed so you dont cut anything just with a touch
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
Source code man
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
bro this is a cutting edge tutorial
Thanks I hope it slice up a good time :D
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 🤘🏼
Dankeschone Diavolo ! :D I'm glad I was able to help and feel free to link me your game once ready. :)
"Wake up babe! A new Valem tutorial just dropped."
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 :)
et c'est des messages comme le tien qui me motive a continuer de faire des tutos merci à toi ! :)
Ah c'est pour ça cet accent Français, je me disais bien que ça sentait familier XDDD@@ValemTutorials
super tutoriel, merci !@@ValemTutorials
for those that can't get it to work with mesh you have to enable read write on the mesh in the assets
I have it on but still is not working
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.
I was currently making a beat saber clone so.. the timing of this tutorial is so perfect for me!! THANK YOU SO SO MUCH!! 💙💙💚💚❤❤💛💛
Was looking for a good slicing tutorial for a while so you saved me. Thanks!
Thanks so much for the detailed tutorial, very helpful!
You're an absolute legend! Thank you for another great video!
I'm glad I was able to help and thank you for another donation Jostein you're the best
finally someone !! Thank you sooo much!!!
Wow, that valve code looks fancy. I used simply 2 positions with time.deltatime before.
Like if you agree the best part of this video is hearing Quentin say “upper hull”
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
Amazing, thanks for sharing!
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;
OH GOD. THANKS YOU. Valem should pin this comment
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
Thanks, ezy slice is still through all thoses years a great tool but what do you use to slice skinnedmesh renderers ?
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?
Praise the Sun!
4:04 what's a lover hull? jk lol
Nice video and I was wondering how do I play my unity vr game on my oculus vr quest 2?
Can i slice animated objects?
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?
Hey valem ur tutorials are all amazing this cut is amazing try to make a tutorial of a soft mesh cut ,
Thankyou
Thanks Mohan ! :D But what's a soft mesh cut ?
@@ValemTutorials exactly like a surgical cut like how a surgeon cuts the skin during a surgery
is that even possible
I remember doing something like that in VR but it came packaged with a lot of warnings lol
What about poking a hole through an object?
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.
Nice tutorial, do you have any ideas about curve slicing in VR?
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
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!
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.
loverHull is indeed very lovely 😄
man I had so much trouble trying to say that word :D
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?
you killed the homie suzanne
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.
Can you double cut objects?
Yes just give the sliceable component to the spawned object and you can cut them again
Thank you so much!@@ValemTutorials
how to add xr grab interactable to upper hall and lower hall so ican grab that?
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.
could you please do a tutorial on melee combati vr?
Will this work for 3D humanoid models?
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 ?
Have you found the answer to your question
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?
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.
How compute heavy is this ? Would it work okay on Quest 2 ? Thanks for the tutorial btw
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. :)
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
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?
apparently the linecast was too deep inside the collider of the cutting object, so it could never touch the slicable one.
you sound like brackeys
MM
Cut it out, man
This video is super choppy
@@beardordie5308 Yeah but I'm glad this video made the cut. :D
Wow... he sliced right through that illegal immigrant from africa...
Time to make metal gear rising VR.
Oh wait how do I rip the assets...