+ 3
I want my player to Move only in Vertical Direction in Unity, but the player is moving Crosswards (X /) why? How to solve this ?
My Input and Expected output :- I want my player to move in the vertical direction only, when the person (Anyone) clicks the UI Button of upward direction the object must go upwards. Similarly, When the person click the UI Button of downward direction the object must Come Down Issue :- The Player is not Following the same it is moving Crosswards (X, /). There must be a Problem in axis pls Help Link of Code is above check it. Link:- https://code.sololearn.com/cl32x3I9UeMD/?ref=app
8 Respuestas
+ 2
YUGRAJ
Yes, in that line there was an issue
After an Quite Search I Solved my Issue
(Other Full Code is right)
It should be like this :-
private void FixedUpdate()
{
rb.velocity = new Vector2(rb.velocity.x, Vertical Move * Time.deltaTime);
}
Thank You
+ 3
Yeah Christopher Comstock (*☻-☻*) 😢😢
+ 2
In this line
rb.velocity = new Vector2(VerticalMove, rb.velocity.x);
You should pass verticalmove as second argument as it denotes y axis first argument is for x
+ 2
Yash Saple there is a YouTube channel named brackeys best channel for learning unity try it maybe you learn new things😁
0
Marshmello =)
I am as well a Beginner I completed my First game Yesterday. But that game was not fully made by me I just made it to get to know how the unity Engine works.
Still I am having a Problem in aspect ratio of the game ') but I will fix it very soon.....
I don't know much but I practice in different way.
For example :-
( WRITE YOUR NAME IN INPUT )
https://code.sololearn.com/c8GS3LZ2F2Oe/?ref=app
Thank you :={