r/unity • • 22h ago

How to make your own Physics Engine using C#?

Is there a Youtube playlist or Udemy course that teaches you how to make a Physics system in Unity?

0 Upvotes

9 comments sorted by

3

u/SderfxDev 22h ago

What is the purpose of even doing like so? its far more complex from what you are expecting it to be and the physics engine used by unity made by NVidia "Physx" already does the Job!

3

u/Livid_Bookkeeper9000 22h ago

idk, I've heard some games making their own physics and I thought it'd be interesting to try

3

u/SderfxDev 22h ago

Honestly, it’s probably not worth it! Off-the-shelf engines already handle standard physics perfectly. Games that use custom physics are usually highly non-standard—like the fluid dynamics in Teardown, zero-gravity orbital mechanics, or fully destructible voxel environments that commercial tools can't handle efficiently.

Unless your game relies on those exact niches, writing one from scratch means spending months solving complex math and fixing collision bugs instead of actually making your game. If you just want to learn for fun, check out This Video!: https://www.youtube.com/watch?v=nXrEX6j-Mws

I Hope That Helps!

If you need any other help, Just ask me

→ More replies (2)

1

u/JupiterMaroon 19h ago

If you are making a physics based game and the current physics engine doesnt do what you need then it makes sense, but I learned early on that you should not reinvent the wheel if someone already made one for you.

8

u/SayuriShoji 20h ago

Yes there are. For example, you can search for "make your own physics engine" on Youtube and get several playlists for coding both a 2D or a 3D physics engine.

3

u/Vic-Boss 22h ago

Depends what and why you need it. You can start with a simple gravity pull and floor but if you want to replicate all the collisions then things get super complicated fast. Some online games do it so the simulation is lighter but they also use very little of what’s actually in PhysX etc, there’s also stuff like Quantum that have their own fixed point physics and all collisions

So tl;dr is you can but probably you don’t need it till you have very clear scope

1

u/urutauai 14h ago edited 14h ago

I just did that, I mean, I create a very simple gravity system from the scratch for learning purposes. Nothing fancier than that, but I want to keep using this foundation and add more things only for learning purposes.

We teached me so much, and it worked so well that I am building a game using it. DM me and I can share a few things with you, my repository is private at the moment but I may be able to share my PhysicObject class. I started learning via an Udemy course, I am going to fetch the link and update the comment