Inverting rotator makes pawn behave weirdly.

Hello! I am having diificulties with a blueprint for player controllable tank. I want left thumbstick to do all the controls - Finding a vector from thumbstick input axes and adjusting pawn rotation accordingly + detecting numerical float values as absolutes to determine local offset delta X. Now What i specifically want to do is to make pawn to keep it’s rootation if it starts moving backwards and not rotate toward Rotator from input (basically inverse rotator). However when inverting or subtracting/adding 180 to Yaw pawn behaves weirdly and does not respond to backward motion.
In picture You can see the whole function with some comments.

I thank You in advance, o Wizards of UE

What do you want to do? I don’t understand.

Whenever statement under “Checking if input angle >90°…” is true, i want the pawn to move backwards instead of rotating around to face the input vector.

I’ll do a new one for you later,if others haven’t solve it

Would highly appreciate the effort. I believe I might be fixating on wrong segments of code and there might be better and more efficient logic

Sorry,you got me on this one.
I did some experiments,and I couldn’t make it…
It’s harder then I think…

I kind of did it, But the effect is not good.
And the logic is buggy.
I’m practicing myself.


If the effect is similar to what you want,you could do some refining.

I hope someone could offer a more simple and clear logic,so I can learn from it.

I love it! Even if it won’t work, I will check this out tommorow. Always good to see same problem through someone else’s eyes. Will update here on the progress! Thanks a lot!

So I did not use Your variant, but after studying it, it gave me some ideas, so I just rewrote the code anew and I believe the key change was inverting the vector just as it was created, during backward motion. I am attaching the blueprint pictures that work for me. Also note, I am not using pawn movement component.

Regards!



1 Like

Great job!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.