B
B
BadCats2017-08-30 13:49:29
C++ / C#
BadCats, 2017-08-30 13:49:29

Axis inversion (standard)?

There is a standard "Horizontal" axis - with standard values:
f80a0cc8a58f493785f7183e56cb1b07.JPGNow when I rotate the character - i.e. the sprite along the x axis - this axis in the InputManager does not work correctly, to fix this I want to do something like this:

if(fR.transform.rotation.x==-180)
        {

             //инвертировать ось управления (там на скриншоте есть галочка Invert) - т.е что то типа Axixs.Invert=true;
        }
else{Axixs.Invert=false;}

But I do not know how to address this axis? It only gives a numeric value. float move = Input.GetAxis("Horizontal");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2017-08-30
@BadCats

The control axis is not tied to the character in any way. And to use an invert in the input for this is not worth it. GetAxis returns you a numeric value, which you must interpret however you like.
In general, it is strange that there are some problems with rotation - somewhere you messed up with local and global coordinates.
Inversion by hand is easy - GetAxis () * -1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question