Using Local Rotation, need to set relative rotation on different axis without cancelling out the local

I am currently trying to implement the turning/rotating of the wheels on my vehicle. It is a pawn with a raytrace based approach to everything, no wheeled vehicle component or anything fancy. I have all 4 wheels as their own static mesh components in the main vehicle blueprint

Currently this is as close as I can get to figuring out how to tackle this and it works perfectly for me except for one thing- the front wheels wont rotate.

Now, I think I understand why it’s happening, as the SetRelativeRotation node is setting Roll and Pitch back to 0 but I can’t figure out another approach that has the same effect of limiting the range of the angle it can rotate to. I tried getting the relativerotation of the component and splitting the struct and inputting them, but since it’s still SETTING not adding, it just negates the local rotation. When I try to use AddRelativeRotation instead, all the inputs are delta rotation and instead of my input variables controlling the angle, all it seems to do is control the speed of the rotation, while the wheels just keep spinning sideways infinitely. I tried clamping the value, but again, it was applying to the speed of the rotation, while the angle would just cycle indefinitely and the wheels spin sideways furiously. I tried AddWorldRotation as well and everything seems to just make it wobble randomly. I have a strong feeling that there is some sort of vector math I should be doing to get it to co-operate but that’s where any help from you guys would be immensely appreciated. I am not really a programmer, and even though I’m learning and sorting bits of this all out, sometimes I can’t quite find the right piece of the puzzle.

One thing you can do is add an extra scene component between each wheel and the car. Steer on the new nodes, and have the wheels rotate on the actual wheels (with speed) like you do now.


I just saw this, and I want to thank you for the suggestion! It sounds like it could potentially work and I will try it out when I get out of work in the morning! If this works as you describe it may very well solve one of the last big issues in my car setup. I have some odds and ends to tweak but I will be sure to let you know if this works out and I really appreciate you taking the time to answer! I really wish I didn’t have to go to bed now for work! Haha

No problems! Good luck.

Thank you so much! It works perfectly now! I don’t know how I didn’t think of this solution, but if you hadn’t pointed out that it was possible I don’t think i’d have noticed until i’ve pulled all my hair out, lol I just got home from work a little while ago and seeing things in motion all workin right is gonna make it so much easier to sleep!