I have a blueprint which stops the player from continuing in the level until they kill the set enemies, once the player walks into the blocker his camera stops moving along the x axis and doesnt continue until they leave the blocker or ocne the blocker is destroyed. Once the blocker is destroyed the camera postion is meant to lerp to the player position however this randomly doesn’t work, i can have it work 10+ times in a row until suddenly its stops working once or twice. Il attach a picture of my script below and a video of it.
in the video you can see that it worked perfectly fine the first 2 times and then on the last one it didn’t, and on the second run the first one didn’t work but the other 2 did.
You can’t change the parameters while you’re in a timeline, otherwise it won’t function correctly. Which is what you’re experiencing.
Can I ask
- Is the camera in the player?
- Is the camera on a boom?
The camera isn’t attached to the player, and it is on a boom. When you say I can’t change parameters when i’m in a timeline are you referring to me setting the actor location X variable? Because before I put that there I was getting the same error maybe more.
I mean, is the camera in the player blueprint?
If it’s not in the player, why would it be on a boom?
All I’m saying, is that if you recalculate lerp points during a timeline, it will not work as expected.
I can give you some pointers once I understand about the camera.
The camera isn’t in the player bp, and it’s on a boom so I can control the position and distance of it relative to the player. If I didn’t have the boom I would have to manually set the camera location instead of just changing arm length on the boom
I’d try something like this
All you have to do when the player hits the blocking volume, is set that bool.
Would it be possible to do this not on event tick?
A timeline is tick.
But no, not possible ![]()
sorry should have provided more screenshots of the camera BP, but this is how I get the camera to follow the player, the bottom part is once the player gets to close too the blocker and the camera stops following him, would I put what you sent a screenshot of before everything I already have on event tick, and then run my following the player script off of the true branch?
You would put my code instead of everything you have there ![]()
( You might need to flip the meaning of the bool )
Sorry I don’t really understand, as I need that code. The top part is how the camera follows the player when he is not in a blocker and the bottom part is when he is in a blocker. The bottom part stops the camera from following the player along the x axis as they can’t pass through the blocker. Then the thing I’m having an issue with is when the blocker gets destroyed the camera is meant to pan to the player il send a video demonstrating this better.
Well, give it a go. I think it will work, it handles following the player, and you can stop it by changing the bool.
When the player goes into the first collision it stops the camera movement on the X axis until they leave it which is what I want, then when the player kills the attached enemies and they go into the second collision the blocker gets broken and the camera pans to the player. which happened that time in the video perfectly but sometimes it doesn’t. I tried to do what you said but i didn’t get the effect i was after.
What did you get when you tried it?
The camera was constantly lerping to the player causing a slight lag in the camera movement and also once the player went through the blocker and the camera moved onto the player it woulden’t go into the centre until the player stopped moving
Ok. I think you’ll find you need to do something with interp, because it’s not possible to setup a timeline to do this, because the player is moving, and timelines need fixed start and end points.
yeah, I’m trying to figure it out now thanks for the help I didn’t know that about timelines before. I think I can get it working quite soon I’ll let you know
How do would I find out when its finished interpolating? for example I have a branch and the boolean will be whether or not the interp is finished and once it is it will pass though the true node.
You can find out when it’s done by comparing the current X with the target X ( using an approximate = node )

it seems to be working but for some reason it doesn’t interp to the player it does it a bit behind him until i stop moving


