When i completed everything in the tutorial and tested the game, the dashing was way too far, so for anyone that had the same problem here is how to fix it: make private float dashingPower = 6f; instead of private float dashingPower = 24f;
@johnnygamer49333 күн бұрын
1 minute to say that you are going to talk about ladders... when the title is 'How to make Ladders'.
@Rivaldix124 күн бұрын
When i type this line; if (isWalled() && !grounded() && xInput != 0f) it says "Non-invocable member 'PlayerMovement.grounded' cannot be used like a method." Can you please help :(
@SantaGT-sd5je4 күн бұрын
my cube keeps colliding through the floor how do i fix it
@bendux3 күн бұрын
If you want two game objects to collide with each other, both game objects require a collider.
@SantaGT-sd5je3 күн бұрын
@@bendux ok thanks
@SantaGT-sd5je3 күн бұрын
Also how do i add a collider
@kheloras47868 күн бұрын
What a simple and clear tutorial. Thanks for this ! It helps me a lot on my project !
@FKIguanadons13 күн бұрын
lmao bro 100 years later, don't do me like that all kids should experience split screen gaming with their friends. enough of this online bs
@BigCMakesVids2.014 күн бұрын
I copied your actions and I just fell through the floor.
@BigCMakesVids2.014 күн бұрын
Fixed but it's impossible to jump
@bendux10 күн бұрын
You probably skipped one or two important steps in the tutorial.
@BigCMakesVids2.09 күн бұрын
@@bendux I used your code from GitHub, I dunno what's wrong with it.
@bendux3 күн бұрын
@@BigCMakesVids2.0 If you follow the video step by step, you should end up with a moving and jumping player.
15 күн бұрын
Thanks bro it was short and really effective.
@陳柏宇-s6z16 күн бұрын
great tutorial, the video and code are both short and clean, thank you
@edmornee17 күн бұрын
if you want dashing no shift bu right mouse click then here it is!! using System.Collections; using UnityEngine; public class PlayerMovement : MonoBehaviour { private float horizontal; private float speed = 8f; private float jumpingPower = 16f; private bool isFacingRight = true; private bool canDash = true; private bool isDashing; private float dashingPower = 24f; private float dashingTime = 0.2f; private float dashingCooldown = 1f; [SerializeField] private Rigidbody2D rb; [SerializeField] private Transform groundCheck; [SerializeField] private LayerMask groundLayer; [SerializeField] private TrailRenderer tr; private void Update() { if (isDashing) { return; } horizontal = Input.GetAxisRaw("Horizontal"); if (Input.GetButtonDown("Jump") && IsGrounded()) { rb.velocity = new Vector2(rb.velocity.x, jumpingPower); } if (Input.GetButtonUp("Jump") && rb.velocity.y > 0f) { rb.velocity = new Vector2(rb.velocity.x, rb.velocity.y * 0.5f); } if (Input.GetMouseButtonDown(1) && canDash) { StartCoroutine(Dash()); } Flip(); } private void FixedUpdate() { if (isDashing) { return; } rb.velocity = new Vector2(horizontal * speed, rb.velocity.y); } private bool IsGrounded() { return Physics2D.OverlapCircle(groundCheck.position, 0.2f, groundLayer); } private void Flip() { if (isFacingRight && horizontal < 0f || !isFacingRight && horizontal > 0f) { Vector3 localScale = transform.localScale; isFacingRight = !isFacingRight; localScale.x *= -1f; transform.localScale = localScale; } } private IEnumerator Dash() { canDash = false; isDashing = true; float originalGravity = rb.gravityScale; rb.gravityScale = 0f; rb.velocity = new Vector2(transform.localScale.x * dashingPower, 0f); tr.emitting = true; yield return new WaitForSeconds(dashingTime); tr.emitting = false; rb.gravityScale = originalGravity; isDashing = false; yield return new WaitForSeconds(dashingCooldown); canDash = true; } }
@ebmpingu17 күн бұрын
Hours spent just understanding this Bro just used 4min 👏👏👏
@viporidk46122 күн бұрын
u saved me bro, god bless you with all thats good in life , lions walks with lions and hyena walks with hyenas it's what it's lol kekw keep it real 💯 asap rn
@reibarata24 күн бұрын
thanks :D short and simple
@Freeze_Vr5524 күн бұрын
Holy crap thanks so much, the camera is buttery smooth.
@imacube263626 күн бұрын
im bouta blow
@SolaroidSFАй бұрын
Using this to make a quick 2d roguelike in 2 hours for an online course Much love from my laptop <3
@bmonye854Ай бұрын
Ty dude, really thank you, get this for free at last I let you a like and a view
@ActiveVRdudeАй бұрын
did I do something wrong? the groundCheck object isn't following the player object???
@benduxАй бұрын
The ground check must be a child of the player.
@luanlugo6005Ай бұрын
Edson vence o Larry seu lacrador., amei o video my man.
@MrSmashmasterkАй бұрын
How did you make those straight lines in the code at 2:46?
@andyzheng1064Ай бұрын
This is kind of simple ladder. No horizontal control, no climb down. It is not enough to make a real demo
@Herobetter-r4fАй бұрын
IT LITERALLLY DOESNT WORK IT JUST GIVES ME ERRORS
@mr.phewphew4971Ай бұрын
Same
@benduxАй бұрын
Without further information, it's impossible to help you.
@fraz1142Ай бұрын
that was smooth
@loutherobotАй бұрын
TYSM for this amazing tutorial
@iamkennegeeАй бұрын
I could use some help regarding slopes. Much appreciated for the easy to follow tutorials!
@Mballs2478Ай бұрын
Thanks buddy :)
@blasterxt9Ай бұрын
German game developer right 👍🏻
@benduxАй бұрын
Yes!
@blasterxt9Ай бұрын
@@bendux hey buddy Do you have discord server
@bendux25 күн бұрын
@@blasterxt9 There is a link to our Discord server in the description.
@realmorteza802Ай бұрын
It was very useful for me. Thank you very much 👌😍
@CourruptVRАй бұрын
Tell me how to open up the script I don’t know how to edit it pls🙏🙏🙏🙏
@mr.phewphew4971Ай бұрын
I think you need a vistual studio code software
@benduxАй бұрын
Have you tried double-clicking the script?
@bicho1331Ай бұрын
Best tutorial on this topic i've seen. Thank you so much!
@sigma9.90Ай бұрын
when using this, my player wont jump half the time, i have to press the button a good few times before it works
@jackmoon824Ай бұрын
Didn't worked to me, fuck
@benduxАй бұрын
Without further information, it's impossible to help you.
@jackmoon824Ай бұрын
@@bendux Later, I tried again and it worked. Don't remember what was the problem. Thank you so much for this tutorial! And sorry, I was really stressed and angry. Also, thank you so much for you jumping code. Was way better than the one that I had (about different power of jump), thank to that I had no more troubles to put doble jump to a character. You helped me with 2 complicated stuff on my game with your code, thank you so much
@llenvnnАй бұрын
The jump when I had gravity scale on 4 as u showed was short and small so I tried reducing it to 1 and it was higher but now it feels float that character does go down in an fast enough speed u know what I can do to fix it? Or is it a size prob?
@llenvnnАй бұрын
I made the cam size 1.8 and sized down the platform and the player and now it jumps higher but it's just too fast 🥹
@benduxАй бұрын
Decrease the jumping power at the top of the script.
@TimFrescoАй бұрын
Bro I have started making my dream game and I think of a mechanic I need, search it up and you have the tutorial, it is amazing
@flamingfiregunsАй бұрын
my vector3 is underlines in red for some reason could you help meout?
@flamingfiregunsАй бұрын
nvm bro interpolation tip was insane
@no2no182Ай бұрын
When I dash my speed doesn’t increase It works but I’m just not faster
@bendux10 күн бұрын
It probably has something to do with the order of execution in your script.
@tnam_4159Ай бұрын
Good Tutorial
@S.Dimitris-z9cАй бұрын
I used it in my game and it worked perfectly fine. I turned off my pc and when i opened it again (3 hours later) all of a sudden it doesnt work. Why is that? Can anyone help me?
@SlorpleАй бұрын
4:55 theres no "ground check" or "rb" options
@benduxАй бұрын
Make sure that the script is saved and doesn't contain any errors.
@matt1a-bsАй бұрын
This tutorial is perfection. Thank you, brother.
@AzanAhmed-hy7ocАй бұрын
Player movement script:using System.Collections; using System.Collections.Generic; using UnityEngine; public class Movement : MonoBehaviour { public float speed = 100f; public float JumpHeight; public bool InAir = false; private Rigidbody2D rb2d; void Start() { rb2d = GetComponent<Rigidbody2D>(); } private void OnCollisionEnter2D(Collision2D collision) { InAir = false; Debug.Log("InAir false"); } private void OnCollisionExit2D(Collision2D collision) { InAir = true; Debug.Log("InAir True"); } void FixedUpdate() { Vector2 NoMovement = new Vector2(0f, 0f); float moveHorizontal = Input.GetAxis("Horizontal"); if (moveHorizontal > 0) { { rb2d.velocity = new Vector2(speed, rb2d.velocity.y); } } if (moveHorizontal < 0) { rb2d.velocity = new Vector2(-speed, rb2d.velocity.y); } if (Input.GetKeyDown(KeyCode.W) || (Input.GetKeyDown(KeyCode.UpArrow))) { if (InAir == false) { rb2d.AddForce(new Vector2(0, JumpHeight), ForceMode2D.Impulse); } } } }
@scordio2305Ай бұрын
It works perfectly
@glowraptor52282 ай бұрын
is there any way to add a kick off the wall so that if you hold the directional input into the wall, you go upwards and away from the wall
@Heisenburg292 ай бұрын
i can't jump
@ITAgame7772 ай бұрын
But i can
@Heisenburg292 ай бұрын
@@ITAgame777 ok
@benduxАй бұрын
You probably skipped one or two important steps in the tutorial.
@TheAnimatedSquare2 ай бұрын
Bendux, would you maybe consider making a tutorial on 2D conveyor belts? I’m made a rudimentary system using Vector2.AddForce, but I was wondering if there is a smarter way.
@TrashCoonTales2 ай бұрын
Hi since u make 2d movement, could u make a video about edge skipping, so when ur bearly under a platform u get pushed, or when u miss a platform jump by a few pixels u get bumped up? Ur movement is by far the best!
@RadishMalan2 ай бұрын
At first some stuff may fail, but once you start reading and remembering what you do and see in this tutorials you'll see success at some point
@SutKafa2 ай бұрын
nice greek video
@AlesioAlimerkaj2 ай бұрын
Idk why this happens but in the compoment Player Movment it only showsh Script and the name Player Movment