S
S
Senture2018-04-04 21:20:49
Unity
Senture, 2018-04-04 21:20:49

How to prevent rotation of an object by vectors in Unity?

Hello, there was a problem in Unity. It is necessary to bind some object to the character's bone, which is animated. How to make it so that the binding goes only along coordinates without rotation (or prohibit rotation along 2 extra vectors that I don’t need), but leave it moving in space after the bone. Thanks for the help!!!!!!!!!!!!!

This is how I position the weapon before the start of the scene and bind the character to the brush:
5ac516ff06458038843198.png5ac5170631e4a347558383.png
And this is how the weapon rotates after playing the animation:
5ac517171e05a313282069.png5ac5171d630c4714403477.png
And this is how it should be after playing the animation:
5ac5173644370936717245.png5ac5173c18fc0283241910.png

PS In the last 2 pictures, I aligned it manually, but it is necessary that it does not rotate, or rather rotates only along one vector, sort of like only along the Y vector.
Thanks a lot, everyone!!!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Basmanov, 2018-04-04
@Senture

If the gun is a separate object, then for such a case, a special anchor for the weapon is made in the animation, which is animated along with the character. Then a transform with a weapon model is inserted into it. Well, either make a special animation for the weapon, but then you are tormented to synchronize it with the character.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question