OZAV:
As some people donāt get it, Itās just a joke, for living next to Siberia you will definitely have a good sense of humor - anyways, keep us updated on the problem if we can help further, it sounds that it need to be checked if there is an issue of game object being rotated by the game object, instead of by rigid body, or if there are sub objects in the prefab doing that wrong effect, so you need to check that first, before any further code excavations. Your code concept is not bad, but be careful declaring stuff in #C , and than if properly declared - go using the declarations further down the script and what not, as you know - all the wrong things in #C - start in the header declarations (despare ye not - if you have done this in JS - it will be 10 times worse to fix) :).
What do you mean by the word things?
objects or what?
OZAV:
We donāt use Y axis for velocity for runs (translations forward-back), unless you want the object to take off (up vertically), for translation forward-back is the best to use Z axis, which is horizontal one in Unity. So ⦠assumedly Y is vertical axis - anything with Y axis used (with any ± value of more than zero in it), will give you the jumps or falls down, so simply avoid any numbers higher than zero for any axis in your game object that is pointed up, if you want translations forward-back, eg, walk, run, drive, etc, you work with Z and X axes numbers for that (assumedly they are horizontal ones), hope it helps :).
The fact is that when I put rb.velocity.y I have a player with x coordinate, everyone has it, but I canāt understand why, and when I use rb.velocity.y and rb.velocity.x then everything is fine y == y coordinate x == x coordinate
OZAV:
As some people donāt get it, Itās just a joke, for living next to Siberia you will definitely have a good sense of humor - anyways, keep us updated on the problem if we can help further, it sounds that it need to be checked if there is an issue of game object being rotated by the game object, instead of by rigid body, or if there are sub objects in the prefab doing that wrong effect, so you need to check that first, before any further code excavations. Your code concept is not bad, but be careful declaring stuff in #C , and than if properly declared - go using the declarations further down the script and what not, as you know - all the wrong things in #C - start in the header declarations (despare ye not - if you have done this in JS - it will be 10 times worse to fix) :).
and donāt forget that I have 2D