3. Unity 5 tutorial for beginners: 2D Platformer – Movement

Published by Jan Heaney on

3. Unity 5 tutorial for beginners: 2D Platformer - Movement


36 Comments

Kung · May 27, 2019 at 2:13 am

I need some help, I’ve tried this 6 different time and every time when I make the first
Private Rigidbody2D my rigidbody;
It doesn’t work!, also the Rigidbody2D doesn’t become that light blue please help

Dib · May 27, 2019 at 2:13 am

Excellent guide my dude

SUP3RIOR_FURN · May 27, 2019 at 2:13 am

Hi if u could reply that would be great! I did exactly what u did but when i got to myRigidbody.velocity = new Vector2(horizontal, myRigidbody.y); it just tells me 'Rigidbody2D' does not contain a definition for 'y' and no accessible extension 'y' accepting a first argument of type 'Rigidbody2D' could be found (are you missing a using directive or an assembly reference?)

Lukas Sundkvist · May 27, 2019 at 2:13 am

Doesn't work 🙁

Dani Lazar · May 27, 2019 at 2:13 am

I can't "Play" . I have a error, I followed the tutorial correctly. The error is:AssetsScriptsPlayer.cs(23,6): error CS1513: } expected. Can someone help me?(Fast pls)

rebeca acco · May 27, 2019 at 2:13 am

Your script code made my unity get an error that denied me to press play.

Nshan Petrosyan · May 27, 2019 at 2:13 am

Thank you very much
it was really helpfull

Haures Bogdan · May 27, 2019 at 2:13 am

I've made a my first game with Unity. Payed the developer fee on android. Published and made 0$. I have 0 installs. Only 5 friends downloaded my app. I'm very discouraged to make another. Maybe the title is to long for google play: Orange Explorer – classic retro puzzle platformer. I feel like only big to medium studios are getting all the traffic. Or Maybe I need to invest in some ads but that defeats the purpose. I want to make some money from ads not spend. 🙁

Valentin Wirtz · May 27, 2019 at 2:13 am

Cant add the script to my character, it says the script needs to derive from monobehaviour. What does that mean

ZLP TM · May 27, 2019 at 2:13 am

I find this video much better than the other ones I found so far,
it goes into details much better than the other videos and you took the time to explain nearly anything.
Thanks for the help

KING Raf · May 27, 2019 at 2:13 am

Anyone copied the code and can paste it in the comments

HeyItsABird · May 27, 2019 at 2:13 am

When I type input it’s like the code does not exist, it’s not recognised as a function or anything and causes errors, it does not even come up automatically as I type it, any suggestions on a fix?

Yen Boi · May 27, 2019 at 2:13 am

It says that you need to fix everything in the compliler before starting game even if everything is like in the video!

Maxx Handal · May 27, 2019 at 2:13 am

I can't get my player to move. I did evey thing step by step!

DalekHunter 101 · May 27, 2019 at 2:13 am

im having an error:
AssetsScriptsPlayer.cs(27,67): error CS1061: 'Rigidbody2D' does not contain a definition for 'Velocity' and no accessible extension method 'Velocity' accepting a first argument of type 'Rigidbody2D' could be found (are you missing a using directive or an assembly reference?)

This is my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
private Rigidbody2D myRidgidbody;

// Use this for initialization
void Start ()
{
myRidgidbody = GetComponent<Rigidbody2D>();
}

// Update is called once per frame
void Update ()
{
float horizontal = Input.GetAxis("Horizontal");

HandleMovement (horizontal);
}

private void HandleMovement(float horizontal)
{

myRidgidbody.velocity = new Vector2(horizontal, myRidgidbody.Velocity.y);
}
}

Dario .M · May 27, 2019 at 2:13 am

Why dont youtubers put it in the description so we can copy and paste it

The Graham Cracker Hacker · May 27, 2019 at 2:13 am

How do you asign movement speed as a varible so it isn't set at the default 0?

Talha Çetin · May 27, 2019 at 2:13 am

I know it has been almost 4 years but this tutorial is actually good man. I just wanted to point this out. Very well explained.

Roi Gipot · May 27, 2019 at 2:13 am

Holy heck even better than Brackeys. I feel like I am sitting in a class and youre the teacher.
Explaining very well. Great video. Thank you so much man.

P.S I know this is old and you prob wont notice this comment lmao

Cheers at the OPO · May 27, 2019 at 2:13 am

after I typed the scripts, and push play it says, " All compiler errors have to be fixed before you can enter play mode!" can you help me out with this?

Alfredo Araiza · May 27, 2019 at 2:13 am

I guess Im to late hehe, but I just want to thank you, Your videos are so understandable you are an awesome teacher. Thank you really for sharing your knowledge

Nckrieg · May 27, 2019 at 2:13 am

hi I am new to unity and when I try and press play in unity (after I put in the code) it says all compiler errors have to be fixed before you can enter play mode then and error in the console says AssetsscriptsNewBehaviourScript.cs(21,18): error CS0116: A namespace cannot directly contain members such as fields or methods.
thanks in advance.

17 Absolut · May 27, 2019 at 2:13 am

I'm gettin this error right here : "Input Axis horizontal is not set up".

Turtle The Loser · May 27, 2019 at 2:13 am

Best one!!!

itsKplay · May 27, 2019 at 2:13 am

Whenever I try to write rigidbody it remains same . I mean it's not working !

Wajid Ahmed · May 27, 2019 at 2:13 am

Hi, Are you developing online Games? I mean do you have some games online on the Apple store or GooglePlay?

blackpink Lalisa Manoban · May 27, 2019 at 2:13 am

yey thanks! i think this tutorial is better than brackeys.. there is no error.. do you have a tutorial for making a mini dictionary from collected words instead of coins? i'm creating an educational side scrolling game .. and i am extremely new to c# and unity. your tutorials for 2D game helped me alot thank you..

blackpink Lalisa Manoban · May 27, 2019 at 2:13 am

can i use this in android platform with button?

MAC AND CHEESE · May 27, 2019 at 2:13 am

Thank you so much. I can finally continue my project.

GeekBaby · May 27, 2019 at 2:13 am

My VisualStudio does not complete the code the way yours does. "private Rigidbody2D" for example. "GetComponent" and "myRigidbody.velocity" too. What do I do wrong? Thank you

Edit: Found a solution at Stackoverflow. questions/42597501 . Hope it helps someone 🙂

RJ MUSIK · May 27, 2019 at 2:13 am

Better then.beresky..💓

Droson · May 27, 2019 at 2:13 am

🙂 😀

Drek Gray · May 27, 2019 at 2:13 am

the name "myrigidbody" does not exist in the context

Matthew Singer · May 27, 2019 at 2:13 am

How can I add vertical movement

Crispp · May 27, 2019 at 2:13 am

omg thank you, in your tutorials you actually explain things unlike alot of other people

Raid Smith · May 27, 2019 at 2:13 am

thanks a lot. Your code solved my problem with the jittering moving object. Now it stops as a normal object when attaches the wall

Leave a Reply

Your email address will not be published. Required fields are marked *