r/GameDevelopment • u/aphroditelady13V • 6d ago
Newbie Question Is trying to code a custom character controller in Unity as a beginner bad?
Okay so I'm very new to game dev and I'm primarily focusing on a character controller right now. I think that the movement system is the basis of everything. I decided I don't want to use Unitys rigidbody or character controller so I'm making my own one. I heard/read that rigidbody is good when there are a lot of physics but it has pros and cons. I heard that character controller is better for horizontal movement.
My question is, is it kinda a waste of time to try and make my own custom character controller? I'm struggling with all the slope movements and collision. I actually didn't find any video on youtube that tries to do something similar. Any tips are appreciated.
4
u/rakalakalili 6d ago
Is your goal to ship a game as fast as possible? The yeah it's probably a waste of time.
Is your goal to learn about game dev, how things work under the hood, so you can fully understand what's going on and how to change it? Then it's a great idea.
But yes, it's a pain in butt and dealing with slopes, animations, what time to move via physics vs not, how the camera behaves alongside all that, etc means there's a lot to learn. It might be a bit much for a total beginner honestly. But it's a great way to learn.
1
u/aphroditelady13V 6d ago
yeah i have no intention of shipping a game, but yeah I struggle to motivate myself sometimes. because an issue happens and It takes me 2 days to fix or get through it and it's the most basic stuff.
2
u/Ruadhan2300 1d ago
I'd say it's a rite of passage for all devs to realise the limitations of out-of-the box character controllers and roll their own.
Build it, learn from it, build the next even better.
1
u/MidSerpent AAA Dev 6d ago
It’s not bad, it’s a perfectly reasonable thing to focus on.
As a general tip, the time to replace something you are given out of the box is when you get to a point where you are sure you cannot get what you want with what you have.
This is somewhat less of a big deal with Unity because they really don’t give you much out of the box.
There isn’t enough detail about your design and I don’t remember Unity’s default character controller well enough to say starting from their character controller and customizing and improving it is better or worse than starting from scratch.
But I don’t remember it because in the 10 years I spent working in Unity as a pro I consistently replaced it in every project that had characters.
1
u/MephsGameDev 6d ago edited 6d ago
it's only a waste of time if you can't explain to yourself why you want to do this. If it's just to get a firmer understanding of how movement works, it's not a bad idea.
If it's just because you don't understand how to use these components, they handle most of the low level functionality behind object locomotion already and there isn't a lot of good reasons to re-invent the wheel unless the base components do not meet your needs.
So be honest with yourself and determine what the goal here is? As with anything in software development, there's few good reasons to rewrite a feature that does most of what you need it to do already. It's only worth the time if it's about education, the component is missing features you want out of it (and even then you can write a hybrid or wrapper to fill in the gaps and save a lot of time), or you simply want ownership of a proprietary variant of the feature because it will work better with the rest of your architecture.
1
u/Loupyboy 6d ago
I never use the default character controller. I would say, it's better imo to either use a third-party one (like Invector's) or to code it yourself. It's not even that hard to do once you learn to do it once or twice.
3
u/cuixhe 6d ago
It's probably a fantastic way to learn, and i don't think experimenting productively with it is out of reach of a new dev. I don't really know the exact design you're working from. Many games do not need the full physics stuff, or have special requirements for characters in which case you need to.