Learn how to create an Endless Runner Game in Unity, starting with the basics: Player Movement!

I'll take at face value paragraphs two, three and four. You're far more proficient at Unity than I am.

You're not really creating a new object as such, just a new version of the given variable.

I will take issue with this statement, tho. The statement new Vector2 is the creation of a new object. When you assign a new Vector2 to myRigidbody, the previous Vector2 is dereferenced and is added to the garbage collection heap. At some point, it is garbage collected once enough dereferenced memory is sitting on that heap.

Considering that Update() is going to run anywhere from 20 to 60 times per second, depending on system specs, that's a lot of Vector2 objects ending up on the heap. The only way this isn't happening, is if Unity has automatic object pooling somewhere under the hood, but as far as I can tell, from what reading I've done, that is not the case.

Vector2 is a lightweight object, so maybe it's not an issue, but if you're using this new Object throughout all your Update statements for Objects of all weights and sizes, then it will be an issue. Especially on mobile platforms.

I want to develop for mobile platforms, so I want to understand best practices for Unity development immediately, rather than get caught with my pants down later. And I'd prefer to see tutorials engage in best practices, rather than just wing it because it's a simple tutorial and not a "real" project.

I'm not dissing you. I really enjoy your tutorials. You have a very easy and relaxed manner about your lesson plans that I like. I'm just really concerned about best practices in real world gaming applications, especially as related to mobile.

/r/Unity2D Thread Parent Link - youtube.com