Getting Started with Unity DOTS Physics

Поділитися
Вставка
  • Опубліковано 11 вер 2024

КОМЕНТАРІ • 162

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  4 роки тому +12

    Let's look at Unity DOTS Physics! Easy to use with the promise of thousands of physics objects! What Physics demos would you like to see?
    🎮 Play 7 Awesome Games (Action, Strategy, Management) and Help Support the Channel!
    ✅ Get the Game Bundle 67% off unitycodemonkey.com/gameBundle.php

    • @guilllexx
      @guilllexx 4 роки тому

      this video is so cool :) can you make a video on gravity? ... gravity on a planet, gravity system with player moving inside a traveling ship, gravaity toward one or multiple objects, fading gravity over distance ...

    • @dert.3747
      @dert.3747 3 роки тому

      There is a litte error in your update-function where you call Raycast with the direction vector, not the end-point. You call "Raycast(ray.origin, ray.direction * rayDistance)" instead of "Raycast(ray.origin, ray.origin + ray.direction * rayDirection)". Otherwise very helpful as always!

    • @skippythemagnificent8103
      @skippythemagnificent8103 3 роки тому

      I'm getting errors on .entities in the Trigger events, is this depreciated or somthing i am doing, I appreciate this was done some time ago, could do with a heads up :)

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

      really helpful video. Does Physics Shape support 2d

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  4 роки тому +28

    Sorry about my voice being a bit off, been a little sick lately, hope you like the video!

  • @KimboKG14
    @KimboKG14 4 роки тому +8

    Took me 4 days of my vacation, but I finally built a multithreaded raycast system in 3D space.
    Except for you & that other DOTS-guy on yt there is just no resources except for the api.
    We really need to share and spread the knowledge if we want more indie devs to use DOTS!
    I miss those official unity tutorials....
    Hope you keep up the good work.

  • @factopiavideos
    @factopiavideos 4 роки тому +20

    yassss!! keep making videos about complex topics like these. Thank you

  • @sanderliivandi8498
    @sanderliivandi8498 4 роки тому +32

    Hello! I would like to point out that when following along with a fresh project, it is also necessary to install the Hybrid Renderer package as otherwise the entities do not get rendered. This has been mentioned in your ECS tutorial, but I managed to forget that and for some time could not figure out, why the cube and sphere kept disappearing :D

  • @andywatts
    @andywatts 4 роки тому +5

    Very cool. Covered a lot in 20 minutes. Thank you.

  • @siddharthgupta9403
    @siddharthgupta9403 4 роки тому +2

    Amazing video! You have one of the best videos currently available on Unity DOTS. Keep going!!

  • @vildauget
    @vildauget 4 роки тому +1

    Very nice video to get our feet wet in DOTS Physics - thank you. Hope you feel better.

  • @geri4367
    @geri4367 4 роки тому +7

    Awesome! I'd love to see some sort of mini game done fully with DOTS physics. Something like a basic spaceship shoot em up. Also curious if there is some kind of animation system setup for DOTS or not

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +3

      Yup I was thinking of trying to make Space Invaders, sounds like it could work as a simple game and then play around with thousands of enemy ships.
      I believe there's a Animation system currently in the experimental stage.

  • @kil98q
    @kil98q 4 роки тому +18

    looks like an insane amount of code to let that ball jump :(

    • @quoctuanlee3544
      @quoctuanlee3544 3 роки тому +2

      It's a pain in the ass but if we want to squeeze out any ounce of performance from it, we have to :(

    • @kil98q
      @kil98q 3 роки тому +2

      @@quoctuanlee3544 But the idea of getting a huge robot swarm to work sounds pretty worth it ...

  • @KimboKG14
    @KimboKG14 4 роки тому +1

    Actually the raycast job is automatically scheduled in parralel.
    The trick is to built->cast->execute in a multithreaded chain!
    But thanks to your tutorials and 2 days of my vacation I finally have 1k entities casting for the player.
    Point is thought, results are returned as unityEngine.Raycasthit
    so you need to manually convert your desired information into bittable values for further implementation in jobs.
    Posting my basic script on my channel soon.
    Thank you so much for making so good tutorials.
    It's just such a shame that unity hasn't made ecs tutorials like they used to with mono.
    Especially when it comes to such basic things as raycasting.

  • @vrtech473
    @vrtech473 4 роки тому +2

    A tutorial of 2D Physics with 10,000 units bouncing around would be a great learn and fun :)

  • @KimboKG14
    @KimboKG14 4 роки тому

    your tutorials are absolutely amazing! On the spot, awesome audio, and very well researched!
    Plus unity is finally starting to get stable again.
    I made one "pure ecs" game long time ago and looking to make a new one now that we have the neccesary systems in DOTS.

  • @mehmedcavas3069
    @mehmedcavas3069 4 роки тому +7

    Yess finally 😍

  • @piyushmayekar1192
    @piyushmayekar1192 4 роки тому

    This channel is so good! Top tier explanation: precise & concise. Thanks a ton!!

  • @hamzamgaad7131
    @hamzamgaad7131 4 роки тому +11

    where do u learn all this ?
    there is just a few resources on the web !!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +23

      I read the Documentation, Manual, analyze the official samples and do lots of trial and error. These complex DOTS videos take a long time during research before I can make the video.

    • @donkeymonkey4435
      @donkeymonkey4435 3 роки тому

      @@CodeMonkeyUnity U are Absolutely Great!

  • @xaxababa6616
    @xaxababa6616 4 роки тому

    Holy ****! I was thinking about this just now!! Thanks CM!

  • @MikevomMars
    @MikevomMars 4 роки тому +12

    Are there any drawbacks on using both, "normal" and DOTS stuff together in a project? Are there any benefits from partially using DOTS in a project?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +14

      You can and you should mix them together where it makes sense.
      That's exactly what I'm covering in the video going live later today, it uses normal game objects for my animated units but then uses super fast DOTS Pathfinding to calculate the path.
      So you can definitely build your games the normal way using game objects and then just convert the performance intensive parts into DOTS

  • @JamesBowling
    @JamesBowling 4 роки тому

    Thanks for the awesome tutorials. I've found them incredibly helpful for getting my head around the all this DOTS stuff.
    Small thing with your raycast, I'm fairly sure that should be Raycast(origin, origin + direction * distance), not Raycast(origin, direction * distance)

  •  4 роки тому +1

    What I would like to see is unity dots physics and netcode integration. Just started playing around with it a bit myself :)

  • @andrewshandle
    @andrewshandle 4 роки тому

    I'm really enjoying your content, this is great video. Thanks!

  • @starburstdragon
    @starburstdragon 4 роки тому +2

    Great vid - thx :) - there is extremely small number of vids/examples etc that cover unity.physics imo

  • @marcaurelio74
    @marcaurelio74 4 роки тому +1

    Really useful tutorial!
    Thanks for your effort!

  • @azaroth75
    @azaroth75 4 роки тому

    This is a gold nugget, ty!

  • @jamesmillerjo
    @jamesmillerjo 4 роки тому +1

    Yay! I wanted this!

  • @MrGreenlund
    @MrGreenlund 3 роки тому +1

    With the raycast you do at around 12:00, is it possible to access the Physics Shape that the ray hit? I've previously in normal unity physics used it to make my 3rd person camera ignore objects that are very thin etc.

  • @BRINK2011THEGAME
    @BRINK2011THEGAME 4 роки тому +1

    DOTS implement 2D physics as well?

  • @warlockCommitteeMeeting
    @warlockCommitteeMeeting 4 роки тому

    Thank you for sharing this valuable information

  • @NinjaSlv
    @NinjaSlv 2 роки тому +1

    are you using any additional packages for Dot physics?

  • @russellthorburn9297
    @russellthorburn9297 3 роки тому

    I'd love to see you implement the preview version of the Havok Physics Engine.

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

    I have a doubt, entities can only interact with entity? Can a regular rigidbody interact with entity having rigidbody ?

  • @iCeDrAgOn2025
    @iCeDrAgOn2025 4 роки тому

    DOTS is definitely going to be a unique beast to work with once it is finally out of preview. I just honestly hope that they come up with a better way of actually controlling the beast that they're unleashing. What I mean by that is, it is so easy to set things up, But after that initial setup getting access to the underlying data can be nightmare. It's kind of like giving your data to a bank to look after (Unity) then having to break in to said bank just to get access to be able to use it and make simple changes to it.
    Not to be hard on Unity because I think they're moving in the right direction with what they are doing... But at the same time I think that they need to take a step back and really focus. and this is actually where Unreal has an advantage over Unity, Epic they themselves have made a AAA game with their own engine. Unity has not, Sure, Unity has came up with some AAA looking in game footage, but it's not intractable. It's more or less a movie and not so much a game. And making a movie vs a game is completely different, there are so many things to consider.
    Still keep up the good work and exploring the new tech as it comes out, it's great to see some insight in to how it all works and what is potentially possible.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Are you talking about DOTS Physics specifically or DOTS in general? I agree DOTS Physics does seem a bit too complex but DOTS as a whole is already quite a lot user friendly. They have improved usability tremendously these past 12 months and by the time DOTS Core is out of preview it should be very usable.

    • @iCeDrAgOn2025
      @iCeDrAgOn2025 4 роки тому

      @@CodeMonkeyUnity The DOTS Physics seems to be overly cumbersome at this point, especially with what you showed with having to write your own function that is built on the Unit's regular physics. But that in and of itself is partly because it's still in preview so that's understandable that there is going to be some functionality missing. But I was also talking about DOTS in general. Yes it has made leaps and bounds over the past 12 months by adding several QOL features and streamlining the syntax that makes it somewhat easier to work with. But in the end you still have to go though thousands of entities just to find maybe 1 that has met a certain condition. Now to me, that sounds counter productive because it seems to be that the flow control of your program is one way and if you didn't have the mass parallelism provided by BURST it would be worse off than the current GameObject Model that people are used to.
      Take for example with traditional GameObjects sure there would be iteration to possibly change values on several similar objects, and once that object's data has reached a certain condition it has a way messaging the system that something needs to be done, either through events or some form of other call back feature which can identify that specific object. But with DOTS, right now there is no real way to isolate specific data (at least in the examples I've seen online), if you're creating a job to work on a set of entities, then you have to make another job just to handle entities that have met certain conditions. And to me, that seems more system oriented than it does data.
      if you have a scene with 50,000 tree entities that have a translation component and 1 player, and you go searching for the player using foreach, but also wanting it's translation so you can move it. it's still going to have to go through all of the trees until it finds the entity with the the player tag and the translation component. Hopefully that will make sense to you. And it could be that I am missing something here. Have they done away with using archetypes which would kind of minimize that problem because then you can just create specific entities based on an archetype and separate them out in to tree and player and just look for the player archetype and completely exclude looking through all the trees

  • @MNenad
    @MNenad 4 роки тому

    Great tutorial again, but I have a question: I used the bitmask (1u

  • @iCraftDay
    @iCraftDay 3 роки тому

    if your rigidbodys don't fall down, install Havoc physics package (I think)

  • @zhongyechen7639
    @zhongyechen7639 3 роки тому

    thanks for your video, it is very very very helpful

  • @Unforgiven215
    @Unforgiven215 4 роки тому +1

    I'm having a hard time wrapping my head around how ITriggerEvents work. Is the job you created scheduled only when there is a collision with a trigger, or is it scheduled every frame? Is there documentation anywhere where ITriggerEvents are explained?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      Check the official Unity DOTS Physics samples, there's several demos there that use Triggers

  • @fruei_
    @fruei_ 4 роки тому +1

    Hello , awesome video !! . I need help, i'm trying to implement ICollisionEventJob :C, need to play a hit sound when a ball touch a wall or any other object, i need to know if a collision has ocurred, sorry about my english im from argentina

  • @AbyssalManta
    @AbyssalManta 4 роки тому

    Might be a stupid question, but how do you actually use the samples? The instructions tell you to create a new project, import the Hybrid Renderer and stop there. Where do the files you download from the GitHub enter the picture?

  • @electromorphous9567
    @electromorphous9567 4 роки тому

    Such cool. Much helpful.

  • @sabrango
    @sabrango 4 роки тому

    Thx! Why I didn't watch this so far?

  • @stesproject
    @stesproject 3 роки тому

    Hi! Great tutorial!

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

    Hey Code Monkey, for this specific tutorial, did you use the built in render pipeline or SRP? This is crucial to me since I cannot upgrade URP or HDRP from the built in render pipeline and need to make ECS collisions work on the built in render pipeline. Thanks in advance!

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

      Physics shouldn't have anything to do with rendering. This video is pretty old, here I believe I was using the Hybrid Renderer which I believe is related to URP

  • @johncardussi
    @johncardussi 4 роки тому

    I only need 2D raycasts to detect clear driving paths for cars. Is there a lot of speed to be gained by switching to DOTS physics?

  • @Unforgiven215
    @Unforgiven215 4 роки тому +1

    Is there a significant performance gain from using this physics system over the old one? Could you for example have something like 10k rigidbodies with good performance?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +2

      I haven't tested the limits yet but yes it should work for thousands of rigidbodies.
      With normal game objects things start to slow down when you have something like 5k game objects whereas in ECS you can have 100k+

  • @taobowen2016
    @taobowen2016 3 роки тому +1

    Unfortunately the scripts from DOTS/Physics has gone...

    • @taobowen2016
      @taobowen2016 3 роки тому

      All right, install unity physics from package manager and then scripts come out..

  • @seanloughran6714
    @seanloughran6714 4 роки тому

    Really awesome video. I know its in its early stages, but who man they need to make Raycasting way less verbose.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      Yeah the Raycast is great in how many options it has but it definitely needs a simplified utility function.

  • @quzant9745
    @quzant9745 3 роки тому

    Good day! The keys W, A, S, D do not work for me when driving, what could be the problem?

  • @sachanhardik
    @sachanhardik 4 роки тому +1

    The way you did ITriggerEventsJob, i did ICollisionEventJob but I am getting a memory Leak. Any thoughts?

    • @mathiasjensen2841
      @mathiasjensen2841 4 роки тому

      Try using the attribute [updateAfter(typeof(StepPhysicsWorld))] on your system

    • @sachanhardik
      @sachanhardik 4 роки тому

      @@mathiasjensen2841 Thx

  • @quoctuanlee3544
    @quoctuanlee3544 3 роки тому

    When I put stepPhysicsWorld.Simulation at 17:43 , Unity logs out an error that says:
    cannot convert from Unity.Physics.ISimulation to Unity.Entities.EntityQuery.
    So what can I do now?

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

    Hello, With Unity 6 coming out and DOTS being a highlight of it, are there any plans on updating any of these tutorials?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 місяці тому +1

      Yup! UA-cam doesn't support updating videos but I plan to remake them using Unity 6, I'm currently playing with DOTS Physics right now for my upcoming DOTS RTS course

  • @Kidopya
    @Kidopya 3 роки тому

    Aren't there Physics Shape and Physics Body for 2D sprites?

  • @jamesmillerjo
    @jamesmillerjo 4 роки тому +1

    You implemented 'directly adding dots physics' example by adding conversion script to game object (in editor),
    then can I make that process fully code-driven by creating object-adding components-adding conversion script?
    If not, is there a way to *make dots phsics object by pure-ECS approach* ?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      Sure you can make everything straight through code, create an Entity and manually add the Physics components you want like PhysicsVelocity.

  • @yayaskurt
    @yayaskurt 2 роки тому

    Hi, thanks for this tutorial. I wonder why if restitution is 1 it looses velocity on each impact?

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

    it's basically completely different from old system
    like learning from different Game Engine

  • @jamesmillerjo
    @jamesmillerjo 4 роки тому +1

    Can you explain why velocity of both EntityA & EntityB would be modified when collision triggered? Isn't A&B refers Ball & Ground? Why only ball jumps up despite of both entity's velocity changed?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      The Floor entity does not have a Velocity component, it only has a Collider component so that's why it doesnt move.
      If you add a Rigidbody or a Physics Body component then it will end up with a Velocity component which will end up both jumping.

    • @jamesmillerjo
      @jamesmillerjo 4 роки тому

      @@CodeMonkeyUnity Oh, so you mean ball can be A or B by collision case, and it's better applying velocity all of them (and nullify v of floor) than taking overhead deciding which one is ball and which one is floor... Is it right?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      @@jamesmillerjo Yup the ball can be either A or B. In this simple demo I just tried to modify the PhysicsVelocity or both entities but if you want more specific logic you could add another ComponentDataFromEntity to specifically identify which one of the two is the ball.

    • @dr_UiD
      @dr_UiD 4 роки тому

      ​@@jamesmillerjo No he is not applying velocity to all of them . He is testing wich one is Ball and wich one is Ground.

  • @ajaykumar-qw3qr
    @ajaykumar-qw3qr 4 роки тому

    can't find the "Physics shape " under DOTS and Physics.why?

  • @shaunhall7894
    @shaunhall7894 4 роки тому +1

    Code Monkey. What a great vid man. Side by side comparison of using a gameobject vs DOTS. Brilliant! I hate to request another idea on top of all the others we are suggesting for you, but #Geri mentioned on here of doing a small game in DOTS. I second that idea. Similar to a Flappy Bird style game..? I would love to give you a one-time donation. You have a Paypal, GoFundMe?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      Yeah a small complete game is definitely something I'm looking into.
      You can get the Game Bundle which really helps and you get some cool games to play!
      unitycodemonkey.com/gamebundle.php
      Thanks!

  • @Other-Stickman-Games
    @Other-Stickman-Games 3 роки тому

    Awesome

  • @zhongyechen7639
    @zhongyechen7639 3 роки тому

    I am new to unity, I don't know why I give my entity to rigibody. My entities will fall to the bottom of the map, I am sure I have added colliders. Mine is the need to detect the entities near each entity. In addition to using rigibody.index. Is there any other way to get entity? does there have collider.index somthing like that. I check unity.physic, I need to use Overlap query to do that. Thank you. I am not sure what to do, I am not sure do you have these kind of tutorial. if has, please let me know.. Thanks very much.

  • @taylors1545
    @taylors1545 4 роки тому

    How would you efficiently handle different collision pairs? For example:
    The player and enemies shoot a different projectile type. Each projectile plays a different sound and particle system on impact. Each projectile has their unique sounds / particles for hitting different 'pairs' such as the player, an enemy, the floor, the walls, etc.
    Would you write a single system, then depending on the pairs invoke the proper logic using a function pointer?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      Identify objects with Tag components and do the logic based on the Tags.
      I haven't tested so not sure if it would be better to have a single Job handling all possible interactions or multiple Jobs each handling a specific type of interaction. I'm guessing more Jobs will have some overhead but it's likely worth it to keep your codebase nice and clean.

  • @tensennojin
    @tensennojin Місяць тому

    Why the object is not falling at all? i followed all the steps for DOTS version but it remains still.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Місяць тому

      The API has changed a lot in this video. Nowadays all you need is to make a subscene and add a Game Object with a Rigidbody, it will automatically be converted into DOTS physics ua-cam.com/video/4ZYn9sR3btg/v-deo.html

  • @Decurion
    @Decurion 4 роки тому

    In scene start. My objects destroyed, why? I dont see cube and sphere.

  • @siemasiemasiem
    @siemasiemasiem 4 роки тому

    Great video. Please, cover the joints topic in next vid.
    BTW. What you mean by Havok is not free? Unity don't adds Havok to the free version or what? I have to pay havok's people to make a game with havok in Unity?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      Yes Havok is a third-party Physics engine used by many AAA games and yes it has a paid license. Not sure how much it will end up being, it's still available as a free trial.
      Unity Physics on the other hand is free included in Unity.

  • @atur94
    @atur94 4 роки тому +1

    ECS is another level of coding. Extremely hard

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

    JobComponentSystem is depreciated and instead SystemBase is used. What modifications are required in code because if i use SystemBase, i cannot get JobHande inputDeps from anywhere

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

      I have modified the code here a little (it working but giving errors):
      protected override void OnUpdate()
      {
      JobHandle jobHandle = Dependency;
      TriggerJob triggerJob = new TriggerJob
      {
      physicsVelocityEntities = GetComponentDataFromEntity()
      };
      triggerJob.Schedule(stepPhysicsWorld.Simulation, Dependency);
      Dependency = JobHandle.CombineDependencies(Dependency, jobHandle);
      }

  • @themirlabs
    @themirlabs 4 роки тому

    using Unity.Physics dose not work for me. im not sure why but that extension dosent exsist. i have installed the physics package like stated in the video. PLEASE HELP!!!
    also love your videos. a tutorial on making a space game with realistic physics would be awesome. i wanna make spaceships!

  • @Decurion
    @Decurion 4 роки тому

    Can i used colisions, and dont use phisics simulation?

  • @highlewelt9471
    @highlewelt9471 4 роки тому

    Where is the documentation shown in the video? God I hate to navigate Unity's online resources

  • @iskatoysen
    @iskatoysen 3 роки тому

    I can't control any car in demo, how did you do it?

  • @SimplyVanis
    @SimplyVanis 4 роки тому

    Will the DOTS code will become shorter? It looks like a lot of code for really simple mechanics trying to achieve.
    And the code seems to repeat for entities as well. Is it because the DOTS is still in development?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      It's still very much in development and the amount of code is constantly being simplified so yes I assume it will continue in that direction.

  • @divyanthj
    @divyanthj 3 роки тому

    Where do I find the package files? I can't find it in my package manager.

    • @Lelefant_
      @Lelefant_ 3 роки тому

      To see preview packages, enable them in the settings inside the Package Manager.
      But, with 2020.1 they removed the pre-preview packages, e.g. the hybrid renderer.
      They describe a workaround here: docs.unity3d.com/Packages/Installation/manual/index.html
      In short, you can click "Add package from git URL" and paste the corresponding unity package name (e.g. com.unity.rendering.hybrid )

  • @hamsg
    @hamsg 3 роки тому +1

    idk what to think about dots lol making a gameobject jump when it hits the trigger but its 10x the code length and complexity.

    • @LukeAps
      @LukeAps 2 роки тому

      The point is that it's 100x faster. You can have 10000 DOTS balls jumping at 120fps. Or. 100 normal balls jumping at 30fps.
      6 months old, but still.

  • @turntupgamer878
    @turntupgamer878 4 роки тому

    thank you

  • @josueccama303
    @josueccama303 4 роки тому

    Thanks for your videos, I have a question. In case you want to control collisions and physical 2D, how would you do it?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +2

      Right now DOTS works solely in 3D so there's no dedicated 2D Physics but you can easily just make sure the Z never changes.

    • @josueccama303
      @josueccama303 4 роки тому

      thanks, for the answer, I wait for the next chapter of codemonkey :).

  • @GunslingerP
    @GunslingerP 4 роки тому

    Could you make a tutorial on everything needed to start a new project from scratch? I can't seem to figure out why whenever I start a new project, add entities, add physics etc... I get a lot of exceptions and nothing is working.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      If you want to work with DOTS then open a completely blank project and install the Entities package, in doing so it will automatically get all the related dependencies like Jobs.
      If you add the Physics package afterwards you might get some issues with the Performance API, you need to manually select the correct versions, I'm guessing that's an issue that will be solved soon.

  • @user-xj5hp7xv3x
    @user-xj5hp7xv3x 4 роки тому

    5:21 when i start scene objects destroyed. Why?

  • @muuubiee
    @muuubiee 4 роки тому

    Have you done any tests to see what kind of performance difference this gives?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Not yet, I'm planning some torture tests soon, but if the other DOTS tests I've done are any indication that this can be 1000x faster.

  • @neon1595
    @neon1595 4 роки тому

    Hello Code Monkey :) What are your thoughts on the new HAVOK Physics? Should someone like me use it in my project instead of the Unity Physics?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      I haven't fully tested both in order to compare but I believe Havok works faster so if speed is absolutely necessary go with Havok. Although Havok is paid for whereas Unity Physics is free.

    • @usmanmemon
      @usmanmemon 4 роки тому

      Havok physics is free for unity personnel and maybe is free for plus

  • @medmel2160
    @medmel2160 4 роки тому

    Would it be possible to use "rigidebody based on assets" in an ECS project just by putting "convert to entity" like you did?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      Yes when you add ConvertToEntity it will convert a normal Rigidbody component into a DOTS Physics Body

    • @medmel2160
      @medmel2160 4 роки тому

      @@CodeMonkeyUnity great, good to know !
      thank you, and amazing video as usual.. :)

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

      @@CodeMonkeyUnityWhere is the ConvertToEntity script?

  • @likeyou3317
    @likeyou3317 4 роки тому

    The ball with rigidbody stops bouncing after a second, losing all energy. :/
    + the raycast is not accurate, looks like the center of sphere collider is 1cm higher than the actual shpere, but its not. So I have to 1cm higher.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Even if you give it perfect bounciness the underlying values are stored in floats so you don't have infinite precision which does mean that eventually it all comes to a stop.

    • @likeyou3317
      @likeyou3317 4 роки тому

      @@CodeMonkeyUnity Thats an answer I didnt expect. Thanks for tutorial, gonna work with dots so I grab anything i can find

  • @jean-michel.houbre
    @jean-michel.houbre 4 роки тому

    Hello,
    difficult to use the project on Github: tons of errors ^^. On your video, the InputSystem package does not seem to be installed. Because of namespace errors, I installed it, and I went from 110 to 22 errors : \
    The remaining errors are mainly "Assets \ Common \ InputActions.cs (791,39): error CS1061: 'InputActionAsset' does not contain a definition for 'GetActionMap' and no accessible extension method 'GetActionMap' accepting a first argument of type 'InputActionAsset 'could be found (are you missing a using directive or an assembly reference?) "
    .
    I will watch the video quietly and try again when I can understand these errors...

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      What version did you open it on? The samples github comes with the entire project so it should already have all the packages installed correctly, open the project folder with 2019.3.0f1

    • @jean-michel.houbre
      @jean-michel.houbre 4 роки тому

      @@CodeMonkeyUnity 2019.3.0f1.
      It is nice to want to help me, but I think that I am not yet learned enough on Unity to advance on this subject. I prefer to wait until I have a little more knowledge, in particular on the new input system.
      I followed the rest of the video, I almost finished it, it is very interesting (still struggling with the English language, despite the efforts of those who make the subtitles).
      I am trying to reproduce your actions, and I will point out very small difficulties:
      - when you type the code, you are quite often at the bottom of the screen, where the subtitles are located. So pause, move the subtitle bar, resume reading. It's just boring.
      - sometimes you go very quickly with the mouse, without commenting. You must then go back and scan the screen. Nothing insurmountable, it's just boring.
      Your videos deserve to have more views, and I find them really very interesting, we always learn something from them. In fact, I watch very few English channels, but the lack of quality French channels is a powerful motivator ... And in addition, I feel that my level of English is improving :).
      As I wrote to you (it seems to me that I used the form on your site), I bought your games, and I made comments and proposals. I had a good time with these games, and I still do.
      Thank you again for all these videos and happy new year 2020.

  • @user-kn8xx9rn6b
    @user-kn8xx9rn6b 4 роки тому

    我觉得up主很强

  • @tranceemerson8325
    @tranceemerson8325 4 роки тому

    Epic Hello World Program.

  • @marvalgames3939
    @marvalgames3939 4 роки тому

    Great as always. Another inept tutorial?? That's what it sounds like to me for some reason.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Heh it's "in-depth" but yeah I can see how it sounds a bit odd

  • @nukulargames6315
    @nukulargames6315 4 роки тому

    How well does regular unity physics and DOTS physics play with each other? Like, say DOTS colliders hitting gameobject colliders? Or DOTS rays hitting gameobjects?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +2

      They don't interact, they live in completely different worlds. You can mix them in the same scene but they don't collide between systems.

    • @nukulargames6315
      @nukulargames6315 4 роки тому

      What about a hybrid approach, using only DOTS physics but still referencing the original gameobject with monobehaviors that aren't DOTS friendly.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      @@nukulargames6315 Technically you could have an invisible collider in the DOTS World and on every Update move a GameObject to the same position as the Entity but that is a very convoluted way of doing things.

  • @NachoMan154
    @NachoMan154 4 роки тому

    My Sphere does not fall. Without converting them to entities it works! :/

  • @47Mortuus
    @47Mortuus 4 роки тому

    Is it still accurate?
    Is unity physics changing constantly at the moment?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      It's still in development but I believe everything in the video still works

  • @dabspace5541
    @dabspace5541 4 роки тому

    Hey I am completely new to game development so which video should I see

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      If you're completely new to Unity start off with the Basics playlist
      ua-cam.com/play/PLzDRvYVwl53vxdAPq8OznBAdjf0eeiipT.html
      After that look through the video list for more beginner tutorials or try following one of the complete simple games I have like Flappy Bird and Snake
      ua-cam.com/video/b5Wpni9KPik/v-deo.html

    • @dabspace5541
      @dabspace5541 4 роки тому

      Code Monkey ,thanks a lot

  • @agtechart
    @agtechart 4 роки тому

    Hi CodeMonkey! What is exactly World.DefaultGameObjectInjectionWorld ?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      It's the default world that gets created and what the objects with the ConvertToEntity script get instantiated into.

    • @agtechart
      @agtechart 4 роки тому

      @@CodeMonkeyUnity got it, thanks so much!

  • @sorackengamer6507
    @sorackengamer6507 4 роки тому

    Hi!

  • @random_precision_software
    @random_precision_software 4 роки тому

    Can you do the HAVOK physics as well?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Yes, you can easily swap between the two

    • @random_precision_software
      @random_precision_software 4 роки тому

      @@CodeMonkeyUnity I should of made it clearer ...can you do a video on it..I tried and got weird results lol

  • @JamesWjRose
    @JamesWjRose 4 роки тому

    The line: return triggerJob.Schedule(stepPhysicsWorld.Simulation, ref buildPhysicsWorld.PhysicsWorld, inputDeps); is showing an issue: the call is ambiguous between the following methods or properties: IBodyPairsJobExtensions.Schedule(T, Simulation, ref PhysicsWorld, JobHandle) and ICollisionEventJobExtensions.Schedule(T, ISimulation, ref PhysicsWorld,JobHandle)
    I have posted the issue here: forum.unity.com/threads/itriggereventsjob-schedule-compile-error.877681/ and if you or anyone has the solution, or even a clue....
    If I find the solution I will post back.
    -------------------------
    EDIT 1: I attempted to run the Unity Physics samples, and they too get this error. So it seems it's something to do with my system. I will update again when I find something else.
    EDIT 2: Solved. I was using Visual Studio Community 2015 and upgraded to Visual Studio Community 2019 and the conflict was resolved. I have no idea why upgrading the IDE resolved the conflict between two functions... but it worked for me.
    -------------------------
    Thanks for this video and all of them, they are a great help.

  • @anonymousone4824
    @anonymousone4824 4 роки тому

    Idk why but 2:18 make me laugh

  • @siddharthtrivedi3322
    @siddharthtrivedi3322 4 роки тому

    If Unity started adding this kind of complex features then they will easily lose their users because in the market game engines are coming those make your life more easy day by day.
    One name is Buildbox, they will provide big competition in this.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +6

      Game Objects and MonoBehaviours aren't going anywhere, if your game has no issues with performance then by all means keep making games as you've always done.
      DOTS is simply another option that is extremely performant. There are many (most) games which have limited design due to performance limitations, that is what DOTS is meant to solve.

    • @siddharthtrivedi3322
      @siddharthtrivedi3322 4 роки тому

      @@CodeMonkeyUnity Yes I understand your point and you are doing really good :)
      I am just talking generally, maybe Unity make this thing compulsory in the future as like they will do LDRP as their default render pipeline.

  • @twitchizle
    @twitchizle 4 роки тому

    All i want local wi-fi based multiplayer game.

    • @lieQT
      @lieQT 4 роки тому

      Doing the networking for games is relatively abstracted from the actual hardware, so learning client/server and p2p architecture will be relevant regardless whether its LAN/WiFi/WAN/p2p - applications dont actually care whether their data is sent via wifi, ethernet cables or some other fake adapter as you might see in a vm. Youd wanna start looking into UDP, bidirectional communication etc

  • @gawer33
    @gawer33 4 роки тому

    nice one but can we off and on that feature without uninstalling unity dots physics

  • @cyberpegasus1311
    @cyberpegasus1311 4 роки тому

    Is this chinese?

  • @alexandreamiel1865
    @alexandreamiel1865 3 роки тому

    protected override void OnUpdate()
    {
    CollisionWorld collisionWorld = m_BuildPhysicsWorld.PhysicsWorld.CollisionWorld;

    UnityEngine.Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    Vector3 rayEnd = ray.origin + ray.direction * 100;

    if (Input.GetMouseButtonDown(0))
    {
    // Vector3 mousePos = Camera.main.Scr
    IgnoreTransparentClosestHitCollector collector = new IgnoreTransparentClosestHitCollector(collisionWorld);

    var raycastInput = new RaycastInput
    {
    Start = ray.origin,
    End = rayEnd,
    Filter = CollisionFilter.Default
    };

    collisionWorld.CastRay(raycastInput, ref collector);
    RaycastHit hit = collector.ClosestHit;
    Debug.Log(hit.Entity);
    }
    }

  • @Jewelsonn
    @Jewelsonn 4 роки тому

    Too Time consuming,