What is a Transform

Comments

If you have any questions please post them in the comments and I'll do my best to answer them

Codebuzz

Thank you for advertising ...I found out an awesome channel

Code Monkey

Glad you like what you see!

MrSnowman

thanks a lot again. I code on a daily basis, but unity and its own classes and references get me every time i try it. Thanks for making things clear!

Code Monkey

Glad the video helped!

T-E DV

Subtiles French ?

Please ^^

Durian Jaykin

how to set the sprite renderer to a certain sprite, when initializing it?

Code Monkey

I don't think you can directly set the sprite in the constructor.The best way in terms of performance is:GameObject gameObject = new GameObject("mySprite", typeof(SpriteRenderer));gameObject.GetComponent<SpriteRenderer>().sprite = mySprite;

G1K777

In UnrealEngine4 you have also parent and child objects. It's possible to create a parent object, for example a car and add functions to it, like acceleration, turning, braking etc then you can duplicate this parent object and create child objects, different cars like BMW, Audi, Benz etc. Can i do the same in Unity? But all child object have their own world position and you don't use the parent object ingame.

Code Monkey

I'm not familiar with how Unreal works but what your describing sounds perfect for how Unity handles components.You could have a base Car gameObject then add different components to it, like a BMW_Engine, Audi_Engine, BMW_Suspension, Audi_Suspension, etc.

G1K777

+Code Monkey I'm just moving from UE4 and Blueprint scripting to Unity. Want to make my first game, no matter what game just a game... and then keep coding.

Ruben Izquierdo

omfgugfqflic, i spent almost an hour trying to understand the scale of unity. THX <3 1:09

I'm from Portugal so my accent might be a bit weird, I'm saying Global though, where are you hearing Blogol?

kantal

+Code Monkey It sounds like this. I will use to it. Np :)

shantana venkedeswar

When I put transform.position = transform. position + new Vector3(0.01f, 0,0); , my spritedid not move at all but when I set it in transform.position = transform. position + new Vector3(0.07f, 0,0); it moves I don't get it why plus i did exactly at 8:11 but i got an error which is NullReferenceException:object reference not set to an instance of an object ,don't know how to fix it.

Code Monkey

Both those lines will move the transform, moving 0.07f units imply moves more than 0.01fIf you're getting NullReferenceException on the line Debug.Log(childTransform.localPosition); then it means you have childTransform set to null.The variable is assigned in the previous line which does a transform.Find("ChildTransform"); so make sure the game object does have a child and the name is exactly "ChildTransform"

shantana venkedeswar

+Code Monkey thank you! Your tutorial helps a lot

ik0 gaming

So is " + new Vector3 " an alternative to creating a vector 3 variable and adding it to your Transform position?

Code Monkey

What line are you referring to? transform.position = transform.position + new Vector3(0.01f, 0, 0) ?Sure you can do it many waysVector3 newPosition = transform.position + new Vector3(0.01f, 0, 0);transform.position = newPosition;Or you could dotransform.position += new Vector3(0.01f, 0, 0);

ik0 gaming

+Code Monkey Yes, I'm referring to that. Thank you

Tuan Ngoc

Please make more videos to guide beginner like me

TakeDown Games

In need of help how do you make a unity android game immune to hacking

Code Monkey

Preventing hacking is extremely difficult, if you're making a small game I would say don't bother.Giant companies like EA and Activision spend millions trying to stop it and there's always hackers.

Oscar Mario Loria Granados

Awesome, thanks! Please more 2D tips and tricks!

KahVille

This was a well made explanation what transform component does. Having developed a few school projects in unity i was not aware of the local component part. Good reminder on that for me. Thank you for your hard work.

Home OF Games

Hello. In to thank you to all the lessons to provided. But there is a problem is repeated lessons targeted for beginners, in fact brackeys channel and other channels discussed the basics of unity significantly there is no need to re-explained here. Just wish to be there lessons explain how to make a game. Or algorithms and other things like that.