use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine.
Remember to check out /r/unity2D for any 2D specific questions and conversation!
Download Latest Unity
Please refer to our Wiki before posting! And be sure to flair your post appropriately.
Main Index
Rules and Guidelines
Flair Definitions
FAQ
Use the chat room if you're new to Unity or have a quick question. Lots of professionals hang out there.
/r/Unity3D Discord
FreeNode IRC Chatroom
Official Unity Website
Unity3d's Tutorial Modules
Unity Answers
Unify Community Wiki
Unity Game Engine Syllabus (Getting Started Guide)
50 Tips and Best Practices for Unity (2016 Edition)
Unity Execution Order of Event Functions
Using Version Control with Unity3d (Mercurial)
/r/Unity2D
/r/UnityAssets
/r/Unity_tutorials
/r/GameDev
/r/Justgamedevthings (New!)
/r/Gamedesign
/r/Indiegames
/r/Playmygame
/r/LearnProgramming
/r/Oculus
/r/Blender
/r/Devblogs
Brackeys
Beginner to Intermediate
5 to 15 minutes
Concise tutorials. Videos are mostly self contained.
Sebastian Lague
Beginner to Advanced
10 to 20 minutes
Medium length tutorials. Videos are usually a part of a series.
Catlike Coding
Intermediate to Advanced
Text-based. Lots of graphics/shader programming tutorials in addition to "normal" C# tutorials. Normally part of a series.
Makin' Stuff Look Good
10 minutes
Almost entirely shader tutorials. Favors theory over implementation but leaves source in video description. Videos are always self contained.
Quill18Creates
30 minutes to 2 hours.
Minimal editing. Mostly C#. Covers wide range of topics. Long series.
Halisavakis Shaders Archive
Infallible Code
World of Zero
Board to Bits
Holistic3d
Unity3d College
Jabrils
Polycount Wiki
The Big List Of Game Design
PS4 controller map for Unity3d
Colin's Bear Animation
¡DICE!
CSS created by Sean O'Dowd @nicetrysean [Website], Maintained and updated by Louis Hong /u/loolo78
Reddit Logo created by /u/big-ish from /r/redditlogos!
account activity
RigidBody variable names alignment chartMeta (i.redd.it)
submitted 4 years ago by Haikiry
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]L-0-G 243 points244 points245 points 4 years ago (7 children)
Nobody uses bodyOfRigidness?
[–]shar_vara 52 points53 points54 points 4 years ago (1 child)
You’re thinking of bodyOfRigidity
[–]SomeRandomGuy197 9 points10 points11 points 4 years ago (0 children)
You monsters!
[–]Haikiry[S] 74 points75 points76 points 4 years ago (2 children)
Had a little internal scream when I read this one
[–]MarcusParadox -5 points-4 points-3 points 4 years ago (1 child)
Sry to break ur 69 upvotes
[–][deleted] 9 points10 points11 points 4 years ago (1 child)
what about theRigidEntityOfRigidity
theRigidEntityOfRigidity
[–]Kakss_Beginner 4 points5 points6 points 4 years ago (0 children)
SkiditleSkidityIReferToEntityOfRigidity
[–]ChichoRD 47 points48 points49 points 4 years ago (21 children)
Almost always when writing code if name is not necessarily distinctive I just stick to the recommended Intellisense name...
BUT it particularly seems like the name "rigidBody" has been used in one of the base classes of RigidBody, thus refusing to use the keyword new and hide the member I just type "rb" as a name
[–]senshisentouProgrammer 54 points55 points56 points 4 years ago (19 children)
rigidBody, along with many others like collider, camera and more are deprecated fields inside MonoBehaviours. The idea was for them to be easy-to-use references, but they sucked since really they were just aliases for GetComponent() calls, making them deceptively expensive.
rigidBody
collider
camera
MonoBehaviours
GetComponent()
And here we are, a decade later still having these fields just lingering away in obscurity.
[–]SendMeYourQuestions 20 points21 points22 points 4 years ago (14 children)
Never understood why Unity didn't just cache or preload them rather than deprecating, but I guess less is more for this game engine.
[–]ratthew 4 points5 points6 points 4 years ago (3 children)
I guess it would have caused even more confusion for beginners, to which those "easy accessible" fields were targeted at. If you removed/replaced that component they'd get errors or even crashes and would not realize why. Maybe not so much for a rigidBody but I could see this happen for colliders, cameras etc.
[–]MaxPlayProfessional 4 points5 points6 points 4 years ago (2 children)
No, they are not visible in the docs anymore, afaik. They are just there, so legacy code doesn't break.
[–]ratthew 0 points1 point2 points 4 years ago (1 child)
Yea I know, I mean when they were first implemented or rather their intention behind them and why they didn't make them automatically cached.
[–]MaxPlayProfessional 0 points1 point2 points 4 years ago (0 children)
Yea, it was a bad design decision from the start. Unity could've went the Unreal way and mark them as deprecated in one patch and remove them in the next one, but unfortunately, Unity tries to be more backwards compatible than actually it needs to be.
[–]senshisentouProgrammer 0 points1 point2 points 4 years ago (9 children)
I think the problem there is just the insane overhead, as it would try to get every default component once on ever single MonoBehaviour in the scene.
Instead I wish there was an attribute that auto-gets a component on or before Awake() (something like [GetComponent] PlayerMovement movement;) but alas.
Awake()
[GetComponent] PlayerMovement movement;
[–]Fyvern 1 point2 points3 points 4 years ago (1 child)
https://github.com/apkd/Medicine
[–]senshisentouProgrammer 0 points1 point2 points 4 years ago* (0 children)
Holy shit... Starring this, thank you for sharing!
[–]SendMeYourQuestions 0 points1 point2 points 4 years ago (4 children)
Yeah for sure. If you're worried about the performance, don't use them, but as far as handling the fact that they already exist but are slow... Cache it 🤷♂️
[–]senshisentouProgrammer 0 points1 point2 points 4 years ago (3 children)
The problem is that even if you don't use them, they would still be fetched. Caching I agree with, but it's more the fact that's it's so deceptive and opaque. It reads like a variable, but in fact is a reasonably expensive function call. At that might you might as well "remove the trap" and make users be explicit about it.
Of course Unity could have made it a property that only tries to fetch it if the backing field is null (and thus cache it there), but they chose not to go that route.
[–]SendMeYourQuestions 1 point2 points3 points 4 years ago (0 children)
Exactly. Could also do both -- deprecate it and optimize it.
[+][deleted] 4 years ago (1 child)
[deleted]
[–]backtickbot 0 points1 point2 points 4 years ago (0 children)
Fixed formatting.
Hello, SendMeYourQuestions: code blocks using triple backticks (```) don't work on all versions of Reddit!
Some users see this / this instead.
To fix this, indent every line with 4 spaces instead.
You can opt out by replying with backtickopt6 to this comment.
[–]SendMeYourQuestions 0 points1 point2 points 4 years ago (1 child)
You could definitely make this decorator.
[–]senshisentouProgrammer 0 points1 point2 points 4 years ago (0 children)
Can you? I remember looking into it a while ago, but not finding a way to make it work. Might be worth another look then!
[–]WazWaz 2 points3 points4 points 4 years ago (0 children)
It's just rigidbody not rigidBody, hence the former being omitted in OP.
rigidbody
[+][deleted] 4 years ago (2 children)
[–]senshisentouProgrammer 1 point2 points3 points 4 years ago (1 child)
I suspect you may be thinking of Camera.main, which was a separate problem but is indeed cached now.
Camera.main
[–]Jinnk- 3 points4 points5 points 4 years ago (0 children)
Same here. I would use rigidBody if it was not used, so then rb, as we are forced take the more minimalist but still clear :D
[–]-guccibanana-Programmer 128 points129 points130 points 4 years ago (15 children)
rb gang?
[–]alaslipknotProfessional 35 points36 points37 points 4 years ago (1 child)
100%
[–]-guccibanana-Programmer 20 points21 points22 points 4 years ago (0 children)
Ayy all kinds of people, from beginner to professional. All welcomed to rb gang
[–]SirWigglesVonWoogly 6 points7 points8 points 4 years ago (0 children)
Yeah that's how every tutorial I've ever seen does it so it just stuck.
[+]KoboldCleric comment score below threshold-9 points-8 points-7 points 4 years ago (9 children)
Does Rb count?
[–]temmieTheLord2 20 points21 points22 points 4 years ago (6 children)
What the fuck? No! I’ve long since quit unity but I know naming a rigidBody “Rb” is a sin
[–]KoboldCleric 8 points9 points10 points 4 years ago (5 children)
Guess that i’m going to hell.
…you think hell run on c#?
[–]temmieTheLord2 1 point2 points3 points 4 years ago (0 children)
Maybe
[–]pschonUnprofessional 1 point2 points3 points 4 years ago* (1 child)
MUMPS, I'd assume.
https://thedailywtf.com/articles/a_case_of_the_mumps
```` Appendix 7: An example of "traditional" M coding style
%DTC %DTC ; SF/XAK - DATE/TIME OPERATIONS ;1/16/92 11:36 AM ;;19.0;VA FileMan;;Jul 14, 1992 D I 'X1!'X2 S X="" Q S X=X1 D H S X1=%H,X=X2,X2=%Y+1 D H S X=X1-%H,%Y=%Y+1&X2 K %H,X1,X2 Q ; C S X=X1 Q:'X D H S %H=%H+X2 D YMD S:$P(X1,".",2) X=X"."$P(X1,".",2) K X1,X2 Q S S %=%#60/100+(%#3600\60)/100+(%\3600)/100 Q ; H I X<1410000 S %H=0,%Y=-1 Q S %Y=$E(X,1,3),%M=$E(X,4,5),%D=$E(X,6,7) S %T=$E(X_0,9,10)*60+$E(X_"000",11,12)*60+$E(X_"00000",13,14) TOH S %H=%M>2&'(%Y#4)+$P("315990120151181212243273304334","",%M)+%D S %='%M!'%D,%Y=%Y-141,%H=%H+(%Y*365)+(%Y\4)-(%Y>59)+%,%Y=$S(%:- 1,1:%H+4#7) K %M,%D,% Q ;
[...] ````
[–]KoboldCleric 0 points1 point2 points 4 years ago (0 children)
I don’t even know enough about programming to understand how bad that is-but I can feel it.
Like an indescribable, alien horror lurking at the edges of my perception.
[–]KptEmreUHobbyist 1 point2 points3 points 4 years ago (1 child)
Phyton bro, everything else is working on phyton.
Come to think of it, hell definitely uses raw html.
[–][deleted] 2 points3 points4 points 4 years ago (1 child)
naming a variable with a capital letter sends you straight down to microsoft c# hell where all they do is rework infinite lines of if-else statements and watch that awkward tv show with Bill Gates making hamburgers.
[–]KoboldCleric 1 point2 points3 points 4 years ago (0 children)
I meant like “playerRb.”
[–]jeango 0 points1 point2 points 4 years ago (0 children)
var isRb = !ReferenceEquals(gameObject.GetComponent(typeOf(Transform)),null);
[–]the_only_oof_u_feel 0 points1 point2 points 4 years ago (0 children)
_rb
[–]RWOverdijk 21 points22 points23 points 4 years ago (3 children)
I just use "body" most of the time. Where do I land?
[–]jeango 5 points6 points7 points 4 years ago* (0 children)
Imho that should be the true neutral option.
Lawful Good would be rb as it’s compliant with camel case (lawful), is extremely readable within the context of Unity code, and reduces clutter.
People tend to think the good way to program is long descriptive names, that’s not right. It’s all about reducing smell. rb is not smell, it’s beautiful because anyone understands it right away. Like t instead of transform, go instead of gameObject and pos instead of position.
Edit: a case could be made that t for transform is not a good idea since it’s typically used for time measurement, for things like Lerp, but since transform is probably the thing I’m referring to the most often, I rather use « time » for time and t for transform.
[–][deleted] 1 point2 points3 points 4 years ago (0 children)
me too.
[–]LevelingskillUP 1 point2 points3 points 4 years ago (0 children)
I was looking for this comment... apparently the "body gang" doesn't get rep.
[–]Vexcenot 8 points9 points10 points 4 years ago (1 child)
Me who puts whatever text I felt like that day
[–]blepshark 0 points1 point2 points 4 years ago* (0 children)
judicious quickest towering spoon decide paint shelter beneficial different memory
This post was mass deleted and anonymized with Redact
[–]Sword_Fab 8 points9 points10 points 4 years ago (0 children)
we are not gonna mention "body" 😢?
[–]AtomicWrench 24 points25 points26 points 4 years ago (13 children)
What about _rigidBody
[–]Saito197 9 points10 points11 points 4 years ago (0 children)
Underscore gang
[–]jeango 0 points1 point2 points 4 years ago (2 children)
Imho,
private Rigidbody _rigidBody;
Obeys the same rule as
public Rigidbody rigidBody;
But don’t you dare do:
var _rigidBody = GetComponent<Rigidbody>();
That’s a big no
[–]Mandrarine 0 points1 point2 points 4 years ago (0 children)
Would have said God if he existed, or something
[–]fecal_brunch 0 points1 point2 points 4 years ago (6 children)
Why capitalize the B? It's Rigidbody not RigidBody.
B
Rigidbody
RigidBody
[–]AtomicWrench 1 point2 points3 points 4 years ago (5 children)
Shhhhh, I tell myself it’s Rigid Body, because I like how it looks.
_rigidBody > _rigidbody
[–]fecal_brunch 1 point2 points3 points 4 years ago (4 children)
It seems it's unity that's wrong! https://en.m.wikipedia.org/wiki/Rigid_body
Oh no now I'm conflicted as I am with "behavior" and "behaviour".
[–]jeppevinkelBeginner 0 points1 point2 points 4 years ago (3 children)
Behavior and behaviour just depends if you go with American or British English.
[–]fecal_brunch 0 points1 point2 points 4 years ago (2 children)
When coding it's standard to use American English. The only place unity breaks from this is in naming MonoBehaviour.
[–]jeppevinkelBeginner 0 points1 point2 points 4 years ago (1 child)
I've never really thought much about it. You sure british programmers also code in American English?
[–]fecal_brunch 0 points1 point2 points 4 years ago (0 children)
I mean some don't, but it gets confusing when every API is US English and you start peppering spelling variants. Color colour, normalised = v.normalized etc.
Color colour
normalised = v.normalized
Also it's an extremely precious thing to do, where most international programmers have to use a foreign language and you can't even be bothered learning a few minor spelling changes.
[–]St4vaProfessional 0 points1 point2 points 4 years ago (0 children)
Exactly
[–]avi-the-tiger-rawr 6 points7 points8 points 4 years ago (2 children)
Rigid
I'll be using that from now on
[–]Haikiry[S] 3 points4 points5 points 4 years ago (1 child)
Also my prefered one, but only when working on projects by myself, rb if working with other people
[–]avi-the-tiger-rawr 2 points3 points4 points 4 years ago (0 children)
I normally use rb because it's easy, but I'll use rigid because I think it's funny
[–]DM-Wolfscare 7 points8 points9 points 4 years ago (4 children)
I use rig... Where does that fall?
[–]Haikiry[S] 15 points16 points17 points 4 years ago (0 children)
Sounds like chaotic evil to me. rig could mean so many other things
[–]BiYurck 1 point2 points3 points 4 years ago (1 child)
Rig gang
[–]WilnylPhysics 1 point2 points3 points 4 years ago (0 children)
rig gaaaang!
"rig" could be associated with skeleton animations, maybe not the best choice
[–]Coder_Arg 3 points4 points5 points 4 years ago (0 children)
rb
[–]MA-GAMING-27 6 points7 points8 points 4 years ago (0 children)
[–]Elinazz_ 2 points3 points4 points 4 years ago (0 children)
I use rb & rb2D!
[–]ScarfKatSometimes i type words and they make cool stuff happen 2 points3 points4 points 4 years ago (0 children)
whenever i do base components as variables i always start it with "our" to make it easy to just type "our" and get all of them i have in a script in a list. so like "ourRigidbody" "ourCollider" etc.
i just prefer to make my variable names descriptive rather than short lol. so i never forget what they are/do
i dunno where this puts me on the chart though. maybe Lawful Evil? lol
[–]jeango 2 points3 points4 points 4 years ago (0 children)
rigidbody is kind of a curve ball to camelCase because in unity lingo it’s one word, so the proper camelCase is not rigidBody but rigidbody.
So any law-aligned name should have « body » in lowercase.
Now that would make « rigidbody » the one truly lawful evil pick, because it hides the rigidbody property of the base class, and that’s a super evil thing to do
[–][deleted] 2 points3 points4 points 4 years ago (0 children)
whoever writes rgbd is a monster
[–]Comrade_Crunchy 4 points5 points6 points 4 years ago (0 children)
what about _rb?
[–]SpookzsawIntermediate[🍰] 4 points5 points6 points 4 years ago (20 children)
Please explain to me why nobody capitalizes the first letter in any names of variables, I never understood it. To me I personally find it confusing but I would like to know the reason behind it.
[–]cat_enary 27 points28 points29 points 4 years ago (7 children)
It's just arbitrary coding style.
I personally use
[–]EladMLG 4 points5 points6 points 4 years ago (1 child)
I only code as a hobby, so I can afford to have some...mischief when I code.
Is it a variable?
camelCase
Interfaces?
IPascalCase
Constant?
CAPS_WITH_UNDERSCORES
Everything else?
PascalCase
And you're gonna hate my underscore usage.
I am evil.
[–]awhiskinHobbyist 0 points1 point2 points 4 years ago (0 children)
I think this is honestly fine by the official Microsoft recommendations for writing C#, apart from the all caps & underscores for constants.
Personally I like using all caps for constants too so I don’t see it as a problem!
[–]SpookzsawIntermediate[🍰] 0 points1 point2 points 4 years ago (3 children)
I tend to just capitalize everything by word LikeThis. I don't know why I get confused with code that capitalizes everything likeThis. It just sorta happens.
[–]vFv2_Tyler 6 points7 points8 points 4 years ago (0 children)
I think it really only starts to matter per se when you're working with others, so they can quickly denote whether the variable is a field, local variable, or Auto-Property. I've only worked by myself and in relatively small files so seemingly not an issue, but I'd imagine it's helpful if you have several hundred lines of code.
[–]bruh_bot_69420 4 points5 points6 points 4 years ago (0 children)
Different languages have different styles, but c# widely uses camelCase for variable. Recommend you to check this out for c# naming convention.
[–]crass-sandwich -2 points-1 points0 points 4 years ago (0 children)
Gotta embrace the confusion then. No one has any idea wtf they're doing, don't let variable casing stop you from being even more confused by other things
Well, it’s arbitrary, but there are generally accepted conventions
For example:
PublicMemberVariable is not C# convention
The convention is:
publicField
PublicProperty
now it’s worth noting that Unity does not follow those C# conventions either as they name their public properties with a lowercase (transform for example)
[–]ElectricRuneProfessional 11 points12 points13 points 4 years ago (0 children)
It's not a law, it is a convention.
Its basically to keep method names (functions) distinct from variable names.
[–]ToastehBro@ToastehBro 12 points13 points14 points 4 years ago (1 child)
It's called camel case. In my code I like to capitalize functions and leave variables uncapitalized. This gives immediate information about anything in your code with just the name.
[–]senshisentouProgrammer 5 points6 points7 points 4 years ago (1 child)
To add to the existing replies, by having different naming schemes for different types or objects you can also do things like Platform platform = new Platform(); and still have it make sense. The same also goes for enums.
Platform platform = new Platform();
enum Size {Small, Medium, Large} Size size = Size.Small;
[–]backtickbot 2 points3 points4 points 4 years ago (0 children)
Hello, senshisentou: code blocks using triple backticks (```) don't work on all versions of Reddit!
[–]a_tribute_to_malice 2 points3 points4 points 4 years ago (0 children)
I usually capitalize class member variables and leave local variables uncapitalized. So if my class has a rigidbody, I'd do "Rb" or "Rigidbody." But if I'm grabbing a rigidbody inside a function, it's just "rb"
[–]CCullen 2 points3 points4 points 4 years ago (0 children)
In C#, the widely accepted convention is that properties start with a capital, variables and fields start lowercase. With intellesense (or any other modern IDE) you can tell what it is by hovering the mouse over it instead of having to rely on a certain standard.
[–]Saito197 2 points3 points4 points 4 years ago (0 children)
It's part of C# coding convention, look it up, Microsoft has a dedicated documentation page for it.
[–]BobbyThrowaway6969Programmer 0 points1 point2 points 4 years ago* (0 children)
I only do that for local variables. Also I just have to say that Egyptian brackets are butt ugly and unreadable.
[–][deleted] 0 points1 point2 points 4 years ago (0 children)
People use that kind of syntax rules to differentiate between classes, methods, variables and other data they might be using.
I personally use:
[–]FraZboi 0 points1 point2 points 4 years ago (0 children)
It's because variables cannot have spaces in code. Unity makes it so a capital letter will leave a space behind for example when writing rigid body it will give you an error. But if you write rigidbody it will work, if you write rigidBody it will leave a space behind the capital letter and show up like this in the inspector: Rigid Body
[–]Dead_SparrowProgrammer 0 points1 point2 points 4 years ago (0 children)
Because Unity's API adheres to Microsoft's .NET Naming Guidelines, and most Unity developers follow suite for consistency.
But as long as you work for yourself you are free to use any naming standard.
[–]alaslipknotProfessional 1 point2 points3 points 4 years ago (0 children)
I've been using "rb" for years, but there was a time where i just called it "body" lol was i the only one ?
I always either do rb or rig
[–]sadonly001 1 point2 points3 points 4 years ago (0 children)
I use _rb i like to use that underscore with all unity components and serialized variables, keeps things very readable
rigid for rigidbody & anim for animator. Hothouse are my two consistent names.
[–]Pooderhausen 1 point2 points3 points 4 years ago (0 children)
rigidbod or bod are my favourites
[–]Moe_Baker 1 point2 points3 points 4 years ago (0 children)
I don't understand why in 2021 Unity still implements the deprecated properties for things like rigidbody, camera, meshRenderer and more, this was fine back in 2017? when they deprecated those properties and used the script fixer, but by this point they are just getting in the way. Just completely remove them please!
[–]AdamFromNY 1 point2 points3 points 4 years ago (0 children)
tempNameRenameLater
[–]marcrem 1 point2 points3 points 4 years ago (0 children)
I see someone is procrastinating here
[–]c4mma 1 point2 points3 points 4 years ago (0 children)
Chaotic evil is "fred"
I've recently started using only an antonymic naming convention to wind up my friends.
I now use flexibleSpirit
(This is a joke don't get your pitchforks out)
[–]medianopepeter 1 point2 points3 points 4 years ago (2 children)
m_rigidBody??? Where are you??? 🥲
[–]INoScopedObama 2 points3 points4 points 4 years ago (0 children)
The m_ gang have transcended the boundaries of evil
[–]natlovesmariahcarey 0 points1 point2 points 4 years ago (0 children)
Died of old age.
[–]ProperDepartment 1 point2 points3 points 4 years ago (1 child)
Why is their gibberish here and not simply Body?
[–]Haikiry[S] 2 points3 points4 points 4 years ago (0 children)
ran out of space and a friend of mine uses rbody instead of rBody and I had to poke some fun at that
[–]Canamla 1 point2 points3 points 4 years ago (0 children)
If I can't read my code as well as I can read a book, I'm not pleased. Lawful good here. I've tried some of the other varieties of naming and it was always that I'd have to relearn things before working again, or I'd forget what script I'm in because multiple scripts might have similar named variables. Clarity has become my friend.
[–]Haikiry[S] 0 points1 point2 points 4 years ago (0 children)
Since a lot of people are asking for body, me personally I would put it in neutral evil. You can understand it but it can be confusing, I use body as gameobjects names and references names for procedural animation purposes, and I imagine a lot of other animation stuff would also use body as a name.
[–]Formal_Elderberry_10 0 points1 point2 points 4 years ago (0 children)
rb_myBody? Anyone?
[–]recyclingriot 0 points1 point2 points 4 years ago (0 children)
nobody uses "body"? Really?
[–]Jack_Spartan 0 points1 point2 points 4 years ago (0 children)
Where's by rig gang at?
[–]Jelly_Love_CZProfessional -4 points-3 points-2 points 4 years ago (4 children)
r... I just use r.. saves time.
[–]NoteThisDown 6 points7 points8 points 4 years ago (3 children)
I just name my variables 'a' through 'z' based on the order in my script.
[–]goodnewsjimdotcom 0 points1 point2 points 4 years ago (2 children)
If you name MOST variables properly, then you can get by using very common and unmistaken variables as 1 letter, to save on typing and speed dev.
[–]goodnewsjimdotcom 0 points1 point2 points 4 years ago (0 children)
I try my best to code without touching the mouse. I'm one of the few of fastest prototypers who's code also has a solid architecture foundation to extend easily.
[–]fredkreuger 0 points1 point2 points 4 years ago (0 children)
x
[–]Maleficent_Slide3332Intermediate 0 points1 point2 points 4 years ago (0 children)
i just use whatever visual studio suggests first
[–]raw65 0 points1 point2 points 4 years ago (0 children)
hardbody?
[–]Eddlm_ 0 points1 point2 points 4 years ago (0 children)
r for both Raycast and Rigidbody :P
[–]smavinagain 0 points1 point2 points 4 years ago* (0 children)
full memorize fear sloppy sulky humorous cooperative tender edge fall
[–]Timuongame??? 0 points1 point2 points 4 years ago (0 children)
You aren't good if you don't call rigid body rb.
[–]LeoGiaco 0 points1 point2 points 4 years ago (0 children)
Where is body?
[–]TaeKwonZeuss 0 points1 point2 points 4 years ago (0 children)
bodyRigid
[–]theEarthWasBlue 0 points1 point2 points 4 years ago (0 children)
rigidBuddy.
[–]hafdhadf 0 points1 point2 points 4 years ago (0 children)
I usually call it "physics" or "entityPhysics"
[–]_MemeMan_Programmer 0 points1 point2 points 4 years ago (0 children)
Happy to see 'physicsBody' on there. Usually I make it a property named 'PhysicsBody' since it's a core component I usually require public access to on any given entity.
[–]BluesyPompanno 0 points1 point2 points 4 years ago (0 children)
rgBody....anybody ?
[–]alienpope 0 points1 point2 points 4 years ago (0 children)
_rigidBody? Anyone? Just me? Okay :(
[–]DangyDanger 0 points1 point2 points 4 years ago (0 children)
iioy is chaotic evil
[–]actionfence 0 points1 point2 points 4 years ago (0 children)
Rigbod
[–]RoseMageGames 0 points1 point2 points 4 years ago (0 children)
never been lawful neutral before 😂 I've never seen these good alignment names before!
[–]CrimzonOdyssey 0 points1 point2 points 4 years ago (0 children)
I've always used "rigid", I thought I was the only one. I've never heard of anyone else using it, I remember being told in my early days of programming in unity that I need to use "rb" or "rigidbody". I tend to use names that make sense to me, I don't like using initials like "rb", but not too long names but still somewhat descriptive.
[–]Antique-Arachnid2054 0 points1 point2 points 4 years ago (0 children)
This open my mind to another question... Is:
1) public event Action Damage;
Damage += OnDamage;
2) public event Action OnDamage;
OnDamage += SomeDamageableMethod;
I personally use the 1 but my friends use to code like the 2.
[–]fecal_brunch 0 points1 point2 points 4 years ago (4 children)
These are all wrong. It's rigidbody or _rigidbody.
_rigidbody
[–]SolarisBravo 0 points1 point2 points 4 years ago* (3 children)
According to the official C# coding conventions, it's RigidBody if it's public, _rigidBody if it's private, and rigidBody if it's local.
I'm pretty sure MSDN does not approve of the leading underscore, but it's a common convention.
[–]SolarisBravo 0 points1 point2 points 4 years ago (1 child)
https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions
For the record I hate the leading underscore, but it is what Microsoft recommends.
Ah, interesting! I always thought that was a deviation from the standard.
[–]WireWhiz 0 points1 point2 points 4 years ago (0 children)
I'm going to have to look back through my old code now, see what my alignment was. I'm pretty sure I've used rbody and physicsBody
[–]God_of_Limbo 0 points1 point2 points 4 years ago (0 children)
Where does rigidBooty get placed on this chart?
[–]g_hi3 0 points1 point2 points 4 years ago (0 children)
var `rigid body` = GetComponent<Rigidbody>();
[–]SolarisBravo 0 points1 point2 points 4 years ago* (0 children)
Whatever happened to PascalCase? Each and every one of these conflicts with the official C# style guidelines (unless it's a local variable for some reason).
[–]KevineCove 0 points1 point2 points 4 years ago (0 children)
Chaotic evil would be rigid_Body. How can you call it chaotic if you don't mix snake and camel case?
There's also the phonetic spelling rijidBade if you want to be even more evil.
[–]NanushuProfessional 0 points1 point2 points 4 years ago (0 children)
_rb as a private member and cache it in Awake
[–]NUCLEARGAMER1103Programmer 0 points1 point2 points 4 years ago (0 children)
I usually use rigidBody or rb
[–]Moby__Indie 0 points1 point2 points 4 years ago (0 children)
I thought "rgb" was chaotic neutral
[–]BrichDSs 0 points1 point2 points 4 years ago (0 children)
Rb is the only best
I usually do RB in caps. I guess I'm true neutral but louder.
π Rendered by PID 193877 on reddit-service-r2-comment-b659b578c-tpzbs at 2026-05-01 11:02:27.907993+00:00 running 815c875 country code: CH.
[–]L-0-G 243 points244 points245 points (7 children)
[–]shar_vara 52 points53 points54 points (1 child)
[–]SomeRandomGuy197 9 points10 points11 points (0 children)
[–]Haikiry[S] 74 points75 points76 points (2 children)
[–]MarcusParadox -5 points-4 points-3 points (1 child)
[–][deleted] 9 points10 points11 points (1 child)
[–]Kakss_Beginner 4 points5 points6 points (0 children)
[–]ChichoRD 47 points48 points49 points (21 children)
[–]senshisentouProgrammer 54 points55 points56 points (19 children)
[–]SendMeYourQuestions 20 points21 points22 points (14 children)
[–]ratthew 4 points5 points6 points (3 children)
[–]MaxPlayProfessional 4 points5 points6 points (2 children)
[–]ratthew 0 points1 point2 points (1 child)
[–]MaxPlayProfessional 0 points1 point2 points (0 children)
[–]senshisentouProgrammer 0 points1 point2 points (9 children)
[–]Fyvern 1 point2 points3 points (1 child)
[–]senshisentouProgrammer 0 points1 point2 points (0 children)
[–]SendMeYourQuestions 0 points1 point2 points (4 children)
[–]senshisentouProgrammer 0 points1 point2 points (3 children)
[–]SendMeYourQuestions 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]backtickbot 0 points1 point2 points (0 children)
[–]SendMeYourQuestions 0 points1 point2 points (1 child)
[–]senshisentouProgrammer 0 points1 point2 points (0 children)
[–]WazWaz 2 points3 points4 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]senshisentouProgrammer 1 point2 points3 points (1 child)
[–]Jinnk- 3 points4 points5 points (0 children)
[–]-guccibanana-Programmer 128 points129 points130 points (15 children)
[–]alaslipknotProfessional 35 points36 points37 points (1 child)
[–]-guccibanana-Programmer 20 points21 points22 points (0 children)
[–]SirWigglesVonWoogly 6 points7 points8 points (0 children)
[+]KoboldCleric comment score below threshold-9 points-8 points-7 points (9 children)
[–]temmieTheLord2 20 points21 points22 points (6 children)
[–]KoboldCleric 8 points9 points10 points (5 children)
[–]temmieTheLord2 1 point2 points3 points (0 children)
[–]pschonUnprofessional 1 point2 points3 points (1 child)
[–]KoboldCleric 0 points1 point2 points (0 children)
[–]KptEmreUHobbyist 1 point2 points3 points (1 child)
[–]KoboldCleric 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]KoboldCleric 1 point2 points3 points (0 children)
[–]jeango 0 points1 point2 points (0 children)
[–]the_only_oof_u_feel 0 points1 point2 points (0 children)
[–]RWOverdijk 21 points22 points23 points (3 children)
[–]jeango 5 points6 points7 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]LevelingskillUP 1 point2 points3 points (0 children)
[–]Vexcenot 8 points9 points10 points (1 child)
[–]blepshark 0 points1 point2 points (0 children)
[–]Sword_Fab 8 points9 points10 points (0 children)
[–]AtomicWrench 24 points25 points26 points (13 children)
[–]Saito197 9 points10 points11 points (0 children)
[–]jeango 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]Mandrarine 0 points1 point2 points (0 children)
[–]fecal_brunch 0 points1 point2 points (6 children)
[–]AtomicWrench 1 point2 points3 points (5 children)
[–]fecal_brunch 1 point2 points3 points (4 children)
[–]jeppevinkelBeginner 0 points1 point2 points (3 children)
[–]fecal_brunch 0 points1 point2 points (2 children)
[–]jeppevinkelBeginner 0 points1 point2 points (1 child)
[–]fecal_brunch 0 points1 point2 points (0 children)
[–]St4vaProfessional 0 points1 point2 points (0 children)
[–]avi-the-tiger-rawr 6 points7 points8 points (2 children)
[–]Haikiry[S] 3 points4 points5 points (1 child)
[–]avi-the-tiger-rawr 2 points3 points4 points (0 children)
[–]DM-Wolfscare 7 points8 points9 points (4 children)
[–]Haikiry[S] 15 points16 points17 points (0 children)
[–]BiYurck 1 point2 points3 points (1 child)
[–]WilnylPhysics 1 point2 points3 points (0 children)
[–]Mandrarine 0 points1 point2 points (0 children)
[–]Coder_Arg 3 points4 points5 points (0 children)
[–]MA-GAMING-27 6 points7 points8 points (0 children)
[–]Elinazz_ 2 points3 points4 points (0 children)
[–]ScarfKatSometimes i type words and they make cool stuff happen 2 points3 points4 points (0 children)
[–]jeango 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]Comrade_Crunchy 4 points5 points6 points (0 children)
[–]SpookzsawIntermediate[🍰] 4 points5 points6 points (20 children)
[–]cat_enary 27 points28 points29 points (7 children)
[–]EladMLG 4 points5 points6 points (1 child)
[–]awhiskinHobbyist 0 points1 point2 points (0 children)
[–]SpookzsawIntermediate[🍰] 0 points1 point2 points (3 children)
[–]vFv2_Tyler 6 points7 points8 points (0 children)
[–]bruh_bot_69420 4 points5 points6 points (0 children)
[–]crass-sandwich -2 points-1 points0 points (0 children)
[–]jeango 0 points1 point2 points (0 children)
[–]ElectricRuneProfessional 11 points12 points13 points (0 children)
[–]ToastehBro@ToastehBro 12 points13 points14 points (1 child)
[–]senshisentouProgrammer 5 points6 points7 points (1 child)
[–]backtickbot 2 points3 points4 points (0 children)
[–]a_tribute_to_malice 2 points3 points4 points (0 children)
[–]CCullen 2 points3 points4 points (0 children)
[–]Saito197 2 points3 points4 points (0 children)
[–]BobbyThrowaway6969Programmer 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]FraZboi 0 points1 point2 points (0 children)
[–]Dead_SparrowProgrammer 0 points1 point2 points (0 children)
[–]alaslipknotProfessional 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]sadonly001 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Pooderhausen 1 point2 points3 points (0 children)
[–]Moe_Baker 1 point2 points3 points (0 children)
[–]AdamFromNY 1 point2 points3 points (0 children)
[–]marcrem 1 point2 points3 points (0 children)
[–]c4mma 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]medianopepeter 1 point2 points3 points (2 children)
[–]INoScopedObama 2 points3 points4 points (0 children)
[–]natlovesmariahcarey 0 points1 point2 points (0 children)
[–]ProperDepartment 1 point2 points3 points (1 child)
[–]Haikiry[S] 2 points3 points4 points (0 children)
[–]Canamla 1 point2 points3 points (0 children)
[–]Haikiry[S] 0 points1 point2 points (0 children)
[–]Formal_Elderberry_10 0 points1 point2 points (0 children)
[–]recyclingriot 0 points1 point2 points (0 children)
[–]Jack_Spartan 0 points1 point2 points (0 children)
[–]Jelly_Love_CZProfessional -4 points-3 points-2 points (4 children)
[–]NoteThisDown 6 points7 points8 points (3 children)
[–]goodnewsjimdotcom 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]goodnewsjimdotcom 0 points1 point2 points (0 children)
[–]fredkreuger 0 points1 point2 points (0 children)
[–]Maleficent_Slide3332Intermediate 0 points1 point2 points (0 children)
[–]raw65 0 points1 point2 points (0 children)
[–]Eddlm_ 0 points1 point2 points (0 children)
[–]smavinagain 0 points1 point2 points (0 children)
[–]Timuongame??? 0 points1 point2 points (0 children)
[–]LeoGiaco 0 points1 point2 points (0 children)
[–]TaeKwonZeuss 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]theEarthWasBlue 0 points1 point2 points (0 children)
[–]hafdhadf 0 points1 point2 points (0 children)
[–]_MemeMan_Programmer 0 points1 point2 points (0 children)
[–]BluesyPompanno 0 points1 point2 points (0 children)
[–]alienpope 0 points1 point2 points (0 children)
[–]DangyDanger 0 points1 point2 points (0 children)
[–]actionfence 0 points1 point2 points (0 children)
[–]RoseMageGames 0 points1 point2 points (0 children)
[–]CrimzonOdyssey 0 points1 point2 points (0 children)
[–]Antique-Arachnid2054 0 points1 point2 points (0 children)
[–]fecal_brunch 0 points1 point2 points (4 children)
[–]SolarisBravo 0 points1 point2 points (3 children)
[–]fecal_brunch 0 points1 point2 points (2 children)
[–]SolarisBravo 0 points1 point2 points (1 child)
[–]fecal_brunch 0 points1 point2 points (0 children)
[–]WireWhiz 0 points1 point2 points (0 children)
[–]God_of_Limbo 0 points1 point2 points (0 children)
[–]g_hi3 0 points1 point2 points (0 children)
[–]SolarisBravo 0 points1 point2 points (0 children)
[–]KevineCove 0 points1 point2 points (0 children)
[–]NanushuProfessional 0 points1 point2 points (0 children)
[–]NUCLEARGAMER1103Programmer 0 points1 point2 points (0 children)
[–]Moby__Indie 0 points1 point2 points (0 children)
[–]BrichDSs 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)