17.Unity Moving objects with transform.Translate - Unity C# Scripting Tutorial

17.Unity Moving objects with transform.Translate - Unity C# Scripting Tutorial

Charger Games

8 лет назад

158,338 Просмотров

Watch All C# Tutorials Here: http://bit.ly/2wGacFB
Build 10 Games & Apps With Unity & C#: http://bit.ly/2kzmc6R
|------------- ( Click On Show More ) ---------------- |

1. Build 7 2D & 3D Games With Unity: http://bit.ly/2la4WCa
2. Create Full games with Unity + Monetize & Publish: http://bit.ly/1QWI7zq
3. Create Candy Crush,Angry Birds,Spring Ninja BasketBall: http://bit.ly/1QuRg07

| -------------------------------------------------------------------- |

List of Best C# Scripting Books:
1. International: http://amzn.to/2yb3aaC
2. For Indians: http://amzn.to/2eL5iRr

| -------------------------------------------------------------------- |

Best Unity C# Scripting Courses:
1. Learn C# Building Games: http://bit.ly/2w7bpC0
2. Advaced C# Scripting: http://bit.ly/2eLkIVT

| -------------------------------------------------------------------- |

Get 17000+ Premium Video Courses(Free): http://skl.sh/2rxHUaR

| -------------------------------------------------------------------- |

You Can Donate Here:
1. Paypal: https://www.paypal.me/RajaBiswas
2. For Indians: https://www.instamojo.com/@rbsupercool/

| -------------------------------------------------------------------- |

List Of Gears I Use:
1. Mic: http://amzn.to/2fmWJJO
2. Webcam: http://amzn.to/2juJuLz
3. Router: http://amzn.to/2xOJkl7
4. Headphone: http://amzn.to/2fnsceJ

4. Get More Views On Youtube With This Tool: http://bit.ly/2fm6Tdl

| -------------------------------------------------------------------- |

List Of My Youtube Tutorials:
1. C# Scripting Tutorial: http://bit.ly/2wGacFB
2. Android Game Development Tutorial: http://bit.ly/2q8gAPv
3. 2D Racing Game Tutorial: http://bit.ly/2f6JwHo
4. 2D Brick Breaker Game Tutorial: http://bit.ly/1NCvcBy

| -------------------------------------------------------------------- |


Video Description:
Welcome to Unity3D C# scripting tutorial series. In this series you will learn how program in C# in unity to create awesome games. Writing scripts is one of the most important process of creating games in unity3d game engine. If you learn C# from ground up , you can create amazing games in unity. C# coding gives you a lot of control over unity, which you can use to do whatever you want in your game. If you are starting with unity game development scripting, you should start learning C# instead of javascript. C# allows you to write scripts for unity in a more organised way, which would help you to understand your game code later. If you want to be a game programmer then Unity and C# is a great way to start learning about various game development principles. Unity is a full fledged game engine, you can do anything you want, and when you have the power of C# in it, you can achieve anything easily. You can write more robust, readable, faster executable code for unity game development. You may have seen that Unity official tutorials also use C#, since it's better to write code in C# than javascript. javascript is a more free form language, it gives you more freedom which is not that good in long run. If you want to write better code for unity game development, then you should write your code in unity with C#. C# is a great language developed by microsoft for it's .net platform, and unity uses it as a scripting language.

Thanks a lot for watching this video, if you have any questions, write those in comments. I hope you enjoyed. Please subscribe and like , comment , share.

Тэги:

#Unity_(Software) #C#_(Programming_Language) #unity_moving_gameobjects #unity_transform.Translate #unity_Translating_objects #unity_C#_moving_gameobjects #unity_Translate_tutorial #unity_gameobject_Translate
Ссылки и html тэги не поддерживаются


Комментарии:

Banana Man Studios
Banana Man Studios - 12.03.2023 19:01

For the most basic version of Time.deltaTime, it just means a consistent pace regardless of fps or updates in a second

Ответить
victor chavez
victor chavez - 18.08.2022 09:31

The transform component doesn’t appear in visual studio in mac, I need to download something?

Ответить
Bitsaw
Bitsaw - 18.04.2022 22:42

Thank you very much. Every other tutorial makes it look so complicated and not understandable. But thanks to you, I finally understand what does it mean. Once again, thank you

Ответить
Mîsal-i Sahâbe
Mîsal-i Sahâbe - 02.03.2022 20:32

thanks for this tutorial!

Ответить
Somesh Sahu
Somesh Sahu - 30.06.2021 12:11

Nice video thankyou so much

Ответить
Nick
Nick - 25.05.2021 10:11

ace thank you saw this so brilliant.

Ответить
FallennSavage
FallennSavage - 10.11.2020 17:48

Awesome videos! Best around even after 5 years! Still relevant in 2020 thank you!

Ответить
Jacob Sandbach
Jacob Sandbach - 24.09.2020 21:13

Thanks so much man, this helped me alot

Ответить
magma Rojo
magma Rojo - 15.08.2020 05:03

Thanks

Ответить
Manperson
Manperson - 07.07.2020 21:10

Can the speed float only be called speed? Or can it be called other things?

Ответить
Tulip
Tulip - 02.05.2020 08:35

Hi, How do I make the game object to stop after some distance rise in y-direction?

Ответить
NietypowyInformatyk
NietypowyInformatyk - 04.04.2020 23:07

Hello there. You have helped me a lot! I'am really fortunate, that I've found you channel. You've just gained new subscriber! Greetings from Poland! All best my Friend!

Ответить
Apollo
Apollo - 08.03.2020 00:54

Why is changing it's transform component a bad way of moving objects as compared to transform.Translate? What are they doing in the background that makes transform.position bad? Is it inefficiency?

Ответить
ITHAN HUNT
ITHAN HUNT - 20.02.2020 05:07

OR THIS ONE : transform.Translate(10 * Time.deltaTime,0,0);

Ответить
ITHAN HUNT
ITHAN HUNT - 20.02.2020 05:01

transform.Translate(1,0,0);

Ответить
RhamosVhailejh
RhamosVhailejh - 15.02.2020 15:15

Thanks. This helped me understand the nature of the way transform.Translate works in a way that the official API documentation never bothered to explain (and which I couldn't find anywhere else). I thought that transform.Translate meant "move the transform TO x,y,z coordinates", but I realize now that it ACTUALLY means "move the transform BY x,y,z values", which is a VERY important distinction. I've been pulling my hair out for hours trying to figure out why my gameObjects were traveling in the opposite directions as that which they were supposed to be going, no matter what I did. It was because I was adding the current transform.position values into the equation, which I shouldn't have been doing, because it's not "move to", it's "move by". The API documentation is so bare bones. You'd think that people who write official documentation would prioritize actually EXPLAINING stuff. Thanks again. Good on ya.

Ответить
Tino L
Tino L - 13.10.2019 20:54

thanks bro!!

Ответить
Tipu de pe Metin
Tipu de pe Metin - 23.08.2019 21:58

For those who are using AddForce, please, but please use FixedUpdate. Thanks for the tutorial, I've been looking for this kind of thing the whole day :)

Ответить
Aadivya Raushan
Aadivya Raushan - 18.06.2019 17:53

THANK YOU SOOO MUCH
This saved my life for my school project

Ответить
ClownFace
ClownFace - 10.06.2019 10:52

Bhai ap india se best dev ho love u bhai ap sayad chhattisgarh se ho kya mai v hu

Ответить
Ngô Quang Đạo
Ngô Quang Đạo - 28.05.2019 07:27

Thanks you, i want to farming game. Can you help me?

Ответить
Random Tot 2000
Random Tot 2000 - 23.04.2019 15:55

Thank you so much😀

Ответить
LO LO
LO LO - 18.04.2019 11:18

Who else didn't understood Time.deltatime

Ответить
Mr.Epsilon
Mr.Epsilon - 01.03.2019 13:38

how I can random the 3 objects road on position y = 4.15 and destroy them in position y=-4.15

Ответить
Ballista
Ballista - 22.02.2019 10:39

Good day, I would like to have the object constantly moving up by a single touch. The translation stop once not touching due to condition not matching.

Ответить
Nathiyaa Selladurai
Nathiyaa Selladurai - 08.02.2019 18:08

Hi. Im new to this game dev stuffs... Anyway, is it possible to make multiple sprites to move horizontally using this same code..Im using 2d mode..

Ответить
Paul Aldrich Pangilinan
Paul Aldrich Pangilinan - 27.01.2019 09:49

Yo How to move it back and forth like up going up and going down with a pattern

Ответить
Nick
Nick - 21.01.2019 01:58

Thank you so much, Even after 3 years your video is useful. I was using AddForce before I saw transform.Translate script in this video. AddForce is actually weird for the project I am working on because It accelerates slowly and increases the speed over time. Transform is always constant as the speed you choose. Once again Thank you so much for the tutorial I hope you the best day and forward.

Ответить
Biraj Adhikari
Biraj Adhikari - 25.11.2018 21:10

how can i stop that object from moving?

Ответить
Ian Remenar
Ian Remenar - 04.09.2018 20:55

I have a question? How can you make it go then stop then go again

Ответить
Blaaack Mambaaa
Blaaack Mambaaa - 17.08.2018 11:41

how about if we want to stop movement after it reaches certain location

Ответить
mahmoud essam
mahmoud essam - 26.06.2018 20:19

thanks for your tutorial it is very good
i have a question i want to stop the object after a particular distance any help?

Ответить
Pedro Moreira
Pedro Moreira - 16.04.2018 20:51

If I have multiple gameobjects and only one script for the entire project, can I select the object I want to rotate/translate? for example gameobject1.transform.rotate........gameobject2.tranform.translate...... I don´t know if this is possible or if there is another way to do this.

Ответить
Fahd Rashid
Fahd Rashid - 05.04.2018 15:51

Hey. Love your tutorials but I need some help though. How would I move an object up (y axis) a little bit every second?

Ответить
Sauerkraut yo
Sauerkraut yo - 24.02.2018 11:33

Also i want to edit that your speed in talking and typing is very good to explain something. Most of the tutorialguys make it too fast.

Ответить
Sauerkraut yo
Sauerkraut yo - 24.02.2018 11:30

First i thought you will waste my time because all the hello bla bla.

But your Video was awsome!! Good job, smart and compact! :)

Ответить
devansurf
devansurf - 21.02.2018 19:02

Does anybody know a way to apply a transform.translate when a specific animation is playing?

Ответить
PARAS MISTRY
PARAS MISTRY - 13.02.2018 11:42

How to move obstacles continuously in a particular area ?

Ответить
PARAS MISTRY
PARAS MISTRY - 13.02.2018 11:27

I want to apply this change to all other obstacles in game with the same tag. Please help.

Ответить
Money Peso Mindset
Money Peso Mindset - 05.02.2018 11:13

how to make the object back and forth from same position? just like an object pointing on something.

Ответить
berkay bakacak
berkay bakacak - 24.01.2018 11:37

Thank you. Great tutorial.

Ответить
TheMADmk
TheMADmk - 21.01.2018 18:15

Great video. This code makes it move constantly each time update is called, if I want an object to move once to a new position then stop and return how would I code that?

Thanks

Ответить
Obama
Obama - 16.01.2018 23:44

how do you make it so that it moves until a certain point

Ответить
Nikola Bl
Nikola Bl - 29.11.2017 18:08

i made 2d character move with arrow keys and i want to limit his movements so he cant
go past the certain point even if player still holds down the arrow keys

for example i dont want my character to move beyond 2.00 on Y axis
can some1 help me with this? Much appreciated

Ответить
Anshuman Singh
Anshuman Singh - 09.09.2017 03:15

your tutorials are better than udemy
great job bhai, ek no.

Ответить
Amin Amin
Amin Amin - 27.07.2017 15:13

i have a problem i can't write this delta time code in my unity

Ответить
the jalliloy's
the jalliloy's - 12.07.2017 11:01

How do you stop it from moving? Please help! Thanks!

Ответить
Manas Bende
Manas Bende - 03.07.2017 22:30

Hey Hi,
Could you tell me how do I get this cube triggered using box-collider?

Ответить
Ninja1k
Ninja1k - 02.07.2017 01:40

Hey man! thanks alot, how do I make the object go a certain amount to the left and after to the right?

Ответить
Matteo
Matteo - 28.06.2017 18:47

Thank You a lot I resolved my problem :) like

Ответить