Search Unity

Question 2D support? Project tiny? What exactly is going on with 2D Entity physics

Discussion in 'Physics for ECS' started by lgrammer, Feb 24, 2023.

  1. lgrammer

    lgrammer

    Joined:
    Feb 13, 2023
    Posts:
    23
    Was really hoping to use Box2D or have 2D physics shapes and bodies with Entities 1.0 but seems that is not a thing.

    If I switch to .51 hybrid renderer and use the LTS release does that have 2D support? I see that "limit DOF joint" is a bit of a hack currently and I'd be willing to give it a shot. Just not sure how to implement it.

    I was just trying to make a liquid/gas sim with Box2D style colliders in DOTS. Is this currently practical with Unity DOTS now or in the near future or would I be better off just starting a C++ Box2D physics engine from scratch if I need high performance for a 2D game?
     
  2. Deleted User

    Deleted User

    Guest

    probably not the reply you're looking for, but I think a HPC# Box2D physics engine may be a lot easier and perform similarly to a custom C++ one. And you could probably sell it for a pretty penny on the asset store. Main benefit of it being in C# is that you don't need to worry about cross-compilation.
     
  3. lgrammer

    lgrammer

    Joined:
    Feb 13, 2023
    Posts:
    23
    Yea mixed feelings on this since Unity 2D already uses Box2D for GO. Might as well make a C++ Box2D physics engine with an editor and become a competitor at that point if Unity doesn't have plans to do this themselves. Your only competition would be Godot if Unity is just ignoring the 2D market share to compete with Unreal in 3D performance.

    Correct me if I'm wrong but this is the only current workaround for not having Box2D for Entities:

    1) Limit DOF

    https://forum.unity.com/threads/unity-physics-discussion.646486/page-7#post-4460308

    Which alters namespace Unity.Physics.Authoring

    I'm going to give this a shot real quick. If it doesn't hold up well in 2023 with Entities 1.0 then I'm probably going to have to take a step back from Unity till a 2D DOTS friendly physics package or roadmap to one becomes available.
     
  4. lgrammer

    lgrammer

    Joined:
    Feb 13, 2023
    Posts:
    23
    Some errors... at first glance looks like you'd have to do a rewrite of the Havok guys post for Entities 1.0... Going to take a hard pass for now.

    Fingers crossed for 2D support in the LTS version of Entities 1.0 in the near future. If it happens and there's a compatible physics engine for 2D I'll make a second pass on Unity and check it out. I'm not sure where roadmap info is but if there is one for 2D that'd be cool to know about.

    Going to give Bevy a shot next. So long and thanks for all the fish Unity.
     
    david-wtf and Volshar like this.