Answer the question
In order to leave comments, you need to log in
Error CS1061. What's wrong?
Hey! In the last unit I inserted a script to create a platformer. The script was taken from an old video. I corrected 2 errors with the help of this site, the last one remained:
Help! I can send more screenshots.
(if anything, a link to a video about the creation of this platformer: https://www.youtube.com/watch?v=oYaGPeZW8JM
Answer the question
In order to leave comments, you need to log in
This line changes the horizontal speed, so you need to change rigidbody2D to rb and take the current vertical speed:
rb.velocity = new Vector2(move*maxSpeed, rb.velocity.y);
In the same place in the comments to this video:
"in version 5 of Unity in the script you need to write not rigidbody2D but GetComponent.()"
True, it's not very good to use GetComponent on every update.
If possible, it is better to do this at the start of the script.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question