Hey all. I’m using UE 4.10 and i was trying to make a standing still weapon sway system. Sort of like how if you stay still the weapon moves around back and forth. I’ve got it to work a little bit, but the issue is it’s extremely choppy.
That’s the code I’m using. The timeline is just a float that goes from 1-0 in 0.1 seconds. The branch is being executed every 0.1 seconds. Any help would be appreciated.
your on the right track there, each time the set relative location is called it has to recalculate the random values so you will get a different number each update. also the B value of the lerp is constantly changing which will cause issues. so solve these issues you need to be using static locations which can be done by promoting the locations to variables prior to the timeline.
i also agree that the better way to accomplish weapon sway would be with an animation and not a scripted system like this.
You could make a 1d blend space where The X Asia is the stamina and then add the animation with maximum sway to the right side and an still animation to the left. Then input the stamina to the blend space and the swaying would intepolate between the animations.