Character Jitter 4.7.6 (with Video)

Hi all,
I am using UE 4.7.6 and I am seeing this annoying issue with the character jittering continuously. I am moving the character at the speed of 1600 units. I am using a custom movement component, that only moves the character in the direction specified by the controller. I am having the same issues with character movement component.

Here is what I am seeing.
https://www.youtube.com/watch?v=QDCPjUj0-PI&feature=youtu.be … Can anyone explain this?

I am reverting to UE 4.6.1 to see if the issue still persists.

Thanks!

Hi kishoreven, can you provide me with the code files that are related to this movement so that I can see what method you’re using that is giving you this issue? If you wish, you could also upload the entire project which would allow me to tinker around with the movement and possibly find the cause that way.

Hi , here is dropbox link to the movement component code. Dropbox - HoverMovementComponent.zip - Simplify your life … I could give you access to the github URL if you want, but I just reverted the code to continue using Character Movement Component. I do see the issue happen. I can make another capture for that.

In the original video that you provided, were you hitting the brakes at all? I noticed the following bit in your code:

{
	// Dampen velocity magnitude based on deceleration.
	if (currentSpeedSqrd > 0.f)
	{
		float speedToApply = 0.0f;

		// Don't allow braking to lower than max speed if we started above it.
		if (bExceedingMaxSpeed && currentSpeedSqrd < FMath::Square(maxPawnSpeed))
		{
				speedToApply = maxPawnSpeed;
		}
		else
		{
			speedToApply = FMath::Max(currentSpeed - FMath::Abs(Deceleration) * DeltaTime, 0.f);
		}

		Velocity = Velocity.GetSafeNormal() * speedToApply;
	}
}

And the second comment doesn’t make any sense to me, as it says that it shouldn’t allow the user to brake if they are above maxspeed.

Sorry , I seem to have given you a wrong snapshot of the files. I have instead put in the correct snapshot of the project here so that you can play around with the whole thing. Dropbox - ParticleRush.zip - Simplify your life . Also to answer your question, I wasn’t hitting the brakes when i filmed the video. And the ApplyLinearInput() function is copied in from UFloatingMovement 's Apply Input velocity function, since the functionality is exactly the same. I am also experience a similar issue with UCharacterMovementComponent

Thank you for providing the project. I’ve been messing around with the project but the movement hasn’t worked at all. I’m able to turn in place but pressing W or S or moving the left stick on a gamepad doesn’t move forward or backward. I also had to replace some Mesh references in the blueprint for Rush to avoid some compiler errors. Is there any reason in particular that you’re placing the functions for your movement in a separate file than the RushCharacter file itself?

Are you experiencing these movement issues in the version that you sent me as well? From what the code looks like, everything should be working perfectly but there must be something I’m missing.

Bwa! I forgot to set the defaults.I am so sorry about that. In RushCharacterMovementComponent.cpp, please change the definition of InitializeComponent to the following

void URushCharacterMovementComponent::InitializeComponent()
{
	Super::InitializeComponent();

	_jumpKeyHoldTime = 0.0f;

	_currentBrakingGroundFriction = GroundFrictionBrakingStrength.MinValue;
	_currentBrakingDecelerationIncrease = 0.0f;
	
	DefaultMaxSpeed = 1600.0f;
	DefaultMaxAcceleration = 2400.0f;
	DefaultDeceleration = 400.0f;
}

The changed lines being the initialization of DefaultMaxSpeed, Acceleration and Deceleration.

I haven’t had any compilation issues on my end. Let me take a look. And yes! this is the version I am having issues with.

Oddly enough I thought the same as well. So I tried moving on an empty level with just a flat terrain. The jitter would still happen.

No problem, thank you for the speedy reply. I’ll let you know if I come up with anything. I can say I’m getting the jitter issue too, but it seems more prevalent when going over the Track Generator objects.

So this is odd and I’m not quite sure why this is happening. Your functions for MoveForward and ApplyBraking are constantly being called regardless of if W or S are being pressed. This could be causing some issues.

The reason why is because they’re both set up on the same axis and the same value. Both of these functions are conflicting with each other which may be what is causing these jitters.

Try commenting out the logic inside of the ApplyBraking function and leaving MoveForward as it is. When I did this, I could still back up, because MoveForward is still being called but it’s just getting negative values. The jittering seems to be gone for me after that, but I’m not sure as it’s been very intermittent for me in the first place.

ApplyBraking shouldn’t really have any effect on anything since I don’t really use the ground friction in the code yet. It was actually for a future implementation. But you are right about the jitter being very intermittent. I don’t see it too often as well. I am going to try a stripped down version of my code. Remove everything and try only movement and turning. see what happens and build from there. Thanks for your help!

Hi kishoreven,

Did your issue persist after stripping down the code to it’s bare bones? If you still require assistance, I’d be glad to assist you further.

sorry for the delayed reply. Please give me a few more days. I have been held up with other things. So sorry!

Okay so I haven’t narrowed it down yet, but a stripped down version did seem to run without any jitter. I will spend a few more days tracking down the issue. The intermittent nature makes it a bit annoying to know what the actual issue is.

It’s good to hear that you have at least been able to locate it. As you are more familiar with your code than I’ll ever be, I’m sure you’re better suited to this. If you have anymore questions however or find the issue and wish to share it, please let us know.