How can I make the camera switch to have some movement and not be instant?

I hope this website allows embedding. In this blueprint, I’m using the input action SJ_IA_CameraView for toggling between first-person view and third-person view. I also use the SJ_IA_Aim to set the active camera to Aim Cam, which is so close to the scope of the gun. So when I’m in first-person view and I switch to Aim Cam it immediatly switches without any movement happening in between. How can I make the camera switch to have some movement and not be instant?

I have seen this post

But I couldn’t solve my problem.

Here is the link to the blueprint:

I think ‘view target’ blending only works between actors, so no good for switching camera within an actor.

You can either move the currently active camera, or use a second one and move it between locations. You can always make sure you start/end in the right place using sockets or something similar.

I’d be interested if someone comes along with another method…

Could you give an example or a tutorial on how it would be possible to do what you are saying? Also, in the way that you are suggesting, will it be possible to change the “Use Pawn Control Rotation” of the camera to different sockets each time the camera moves to the location of the socket?

1 Like

I don’t know of any tutorials, I’m afraid ( and just had a look ).

Don’t interrupt the current camera setup. Just add an extra camera for the blend.

So if you have a pawn camera on a boom and a gun sight camera, don’t touch them. But add a 3rd camera component to the mix. When you want to move between the player camera and the sight:

  1. Set the extra camera transform to the player camera, then make it the active camera
  2. Lerp the extra camera to the transform of the sight camera
  3. Make the sight camera active

Does it make sense?

I removed this part of my blueprint, and I didn’t use the camera that I had attached to the socket near the scope of the gun.

Instead, I created a timeline and set it up like this:

Timeline:

It is working, but I really played with the length of the timeline and the value of the multiplication, and if you ask me how it could be possible to make the camera go to a certain position (like the position of a socket) using the timeline or something, I wouldn’t know. If you know how it would be possible, then let me know.

It looks like this:

I wouldn’t try and move the first person camera. Like I say, use another.

As for the timeline, you need to lerp between two transforms

That code assumes your gun is a skeletal mesh component in the player, with a socket.

1 Like

This blueprint does not show how you make the Extra Camera active, though. Because in the third step, you said, “Make the sight camera active.”

Can you correct your blueprint?

Just put that on the finish pin

image

There is something confusing to me. Does the blueprint that you showed about Lerping the two transfroms need to be inside the below?

If so, where should I put it?

Sorry, I meant set the temp camera active before running the timeline.

No :slight_smile:

All you do is

  1. Put the temp camera where the FP cam is

  2. Make it active

  3. Lerp the gun camera

  4. Make the gun camera active

That’s it. It’s the same the other way, but in reverse.

I don’t understand why you connect the temp camera (duplication of the first-person camera) to the target of the Set Relative Transform and then use the first-person camera for lerping.
In my understanding, the reverse should be the case, meaning that the first-person camera should be the target and the temp camera should be used for lerping. The reason is that I already have an input action where I toggle the third-person and first-person cameras, so when you say make the temp active, it means for me to go change first-person to temp and toggle between third-person and temp instead! I think it’s pointless. So I chose to set the first person as the target and the temp for lerping.

The other thing I don’t understand is that all of my cameras have their own “Parent Socket.” Why do we even lerp between a socket and a camera? I mean, why are we not lerping between the socket of the sight and the socket of the first-person camera?

All of my sockets are inside bone layers, so when I choose the transform space like you as an “RTS Component,” it does not work correctly, and I choose the “RTS Parent Bone Space.”
In summary, when I check whether the first-person camera reaches the exact location of the sight socket, I notice that it does not. I noticed this after lerping between the first-person socket and the sight socket and setting the first-person camera as the target. The same happened when I lerped between the temp camera and the sight socket and put the first person as the target (which is the reverse of what you showed), and the result was the same. When I switch to an aim or sight camera without any timeline or blend and compare that view to the result of moving the first-person camera using a lerp and timeline to the aim camera location, I notice they are not the same, but I want them to be the same.

Here is what solved my problem:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.