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.