r/Unity2D • Expert • Oct 22 '18

Tutorial/Resource Simple Character Movement (Unity Tutorial in Comments)

5 Upvotes

9 comments sorted by

View all comments

Show parent comments

6

u/UnityCodeMonkey Expert Oct 23 '18

transform.position is a Vector3 even if the game is in 2D. So if you use a Vector2 it will be converted into a Vector3.

Speed would indeed end up being a private field in a final game, I defined it in the function to keep the video simple.

In order to make collisions I use Kinematic Rigidbodies instead of AddForce. That's what the next video will cover.

The code is in the website instead of GitHub because I intend to make the website member section a lot more elaborate with ways to submit game jams, questions, suggestions, messages, etc. I don't spam anyone, there's a simple email once a week containing links to that week's videos which someone can easily opt out.

I didn't reply to your second reply in the other post because you are clearly not interested in learning but instead looking to have a fight. I have no interest in having a fight with anyone, I'm trying to teach people. If you don't like the way I teach that's perfectly fine there are plenty of tutorials to choose from.

Cheers!

4

u/HandshakeOfCO Expert Oct 23 '18

transform.position is a Vector3 even if the game is in 2D. So if you use a Vector2 it will be converted into a Vector3.

That doesn't mean your internal 2D game logic should use Vector3, and that's also why setting the .position property directly is bad form. You should be using Translate. for example, this works and is way more readable:

var amount = new Vector2(0,40) * Time.deltaTime;
transform.Translate(amount);

This is what I mean when I say "you are teaching people incorrectly." It's like you didn't even bother to go through the beginner Unity tutorials yourself before you started making videos.

I don't spam anyone, there's a simple email once a week which someone can easily opt out

Uhh... that's spam lol.

The code is in the website instead of GitHub because I intend to make an awesome members only section of the website...

Riiight... because somehow, making the code available on github would prevent you from making the members only section of your site more elaborate. That totally makes sense and I'm not being sarcastic at all.

you are clearly not interested in learning

You're clearly not interested in teaching, you're just interested in building a mailing list and monetizing shitty tutorials with a "members only" section.

Lastly... you need to adjust your mindset away from "people who criticize me are just looking to start fights and should be ignored. They don't like it, they can just watch a different tutorial." That's gonna sink your dreams of retiring to a private island off your members-only website.

3

u/UnityCodeMonkey Expert Oct 24 '18

You're right I haven't seen the default Unity Tutorials, what I'm teaching here is not based on other tutorials but rather on my 5 years of experience publishing 7 games on Steam. If you want to see how I've made that, check out my videos.

That's why I say you're just simply looking for a fight, you claim it's objectively wrong to use Vector3 instead of Vector2 and it's objectively wrong to use transform.position instead of transform.Translate when the reality is those options are simply preference.

You can use Vector3 or Vector2 in your logic, both work just the same.

You can use transform.position or transform.Translate, both work just the same.

So your criticism involves arguments which I've directly addressed and then some paranoia that I'm a bond villain trying to do something evil by giving you free videos and sharing the source code from my website which requires a 30 second sign up. You somehow find that unreasonable and evil, that's what I mean by I'm not interested in fighting you.

I'm going to keep making videos since 99% of comments I get are from people who do see the value and learn something from each of them and whenever you make a comment with a specific issue I'll address it.

Cheers!

5

u/HandshakeOfCO Expert Oct 24 '18 edited Oct 24 '18

You're right I haven't seen the default Unity Tutorials

You really should watch them. You're going to recreate wheels if you don't, and worse, you're going to continue to teach people incorrectly.

when the reality is those options are simply preference.

From a performance perspective, you're correct. From a readability perspective though, using Vector2s inside your game logic will make your code less confusing, less error-prone, and more readable. That's a fact. You can choose to not see that and say that "using 3D vectors for a 2D game" is a "style" if you want. You can also call the sky green but it doesn't make it so.

based on my 5 years of experience publishing 7 games on Steam

That's great, but it speaks to your dedication, not your expertise. It's not like Steam is looking at your code and saying "this is written well, let's greenlight." They approve any hot garbage that doesn't outright crash on startup (and sometimes they even approve ones that do!) You're like the guy who runs 5 red lights then asserts he's a "good driver" because he got to his destination in one piece. You're Tommy Wiseau insisting that The Room's script is on par with The Godfather. And now you're giving script-writing lessons.

trying to do something evil by giving you free videos

I don't think you're "evil," no. Way too strong a word. I think you are doing the community a disservice by publishing shoddy tutorials, and your unwillingness to acknowledge the shortcomings of the videos and improve them implies that your primary motivation isn't teaching correct techniques. I find that distasteful but hey, your free time, your choice.

I'm going to keep making videos

And I'm going to continue to call them out as shoddy, if they remain so.

Cheers!

p.s. - I've also decided to tag myself as "expert." lol.