Download

Problem with Spring Arm

Hi

Apologies I posted this in the answers page but cant’ see me getting much of a response from there so thought I’d bring it up here and see if anyone else is getting the same problem as me.

The problem I’ve got is the camera is ‘jittery’ when the object it is following is at full speed therefore the spring is at full length with ‘camera lag’ enabled. This can be seen by opening the vehicle level shipped with 4.2, further reproduction steps at the bottom of the thread.

I’ve made a flying spaceship blueprint and attached a spring arm component with a camera as a child of the spring arm for a third person view.

This all works lovely apart from I notice that when I select ‘enable camera lag’ on the spring, when the ship is moving and the spring is at it’s max length the camera jitters alot. I’m guessing there’s a fight between max length of the spring and the spring trying to recoil back to it’s initial length.

I’m using physics to move the spaceship rather than using a translate if that makes any difference.

This is easily reproducible without having to make a flying spaceship:

  1. create a new project using the vehicle template

  2. go into the ‘Sedan’ blueprint and enable ‘camera lag’ on the spring arm component.

  3. accelerate the car to full speed

  4. observe jittery annoying camera.

So question is has anyone else encountered this and got a solution or is it best to just script my own camera?

i think you explained your own question well enough to answer itself. i think it would make sense to make rest length and max length sort of increase/decrease with speed, you can lerp between 0 to max speed.

or, check what example content’s UFO setup, it doesn’t jitter even when boosting.

isn’t that what it already does though? Enabling ‘camera lag’ makes it so when you accelerate the object’s length gets further away from the camera until it reaches its max length so it’s working exactly how I want it to, it’s just when it gets to the max length value that’s when it starts to jitter?

I’ll take a look at the UFO content and see if that has camera lag enabled. I tried the vehicle one and that doesn’t have the camera lag enabled, it does have camera rotation lag on and that works fine. Well until you switch the camera lag on then that causes the vehicle test level to jitter at maximum length aswell.

Thanks for replying I’ll go check the UFO.

Nah the ufo in content examples doesn’t have any of the lag functions switched on but if you switch it on there doesn’t seem to be any jitter. There is some custom camera code going on with the camera.

It did however make me facepalm…delta time…how long have I been working with game engines and I forget delta time when working out movement… I’ll add that to my calculations and see if that sorts it.

Cheers again for the pointer

EDIT: hhhmm delta time made no difference, saying that i’m using physics so it’s a fixed time step anyway so wouldn’t need delta time (i think). Ah well I’ll have to add some custom code I suppose.