Making a peephole; stopping one camera movement and taking control over another.

I was following a tutorial for making a peephole for a door I managed to get almost all of it working. The idea should be that when you interact with the peephole actor, the player view changes from the First Person Camera to the camera attached to the peephole in the door; you’ll be able to control this camera to a limited amount and look around a little bit. Because the interaction is a line trace, if the old First Person Camera doesn’t move, when you hit the interact button the line trace will hit the peephole actor again, and you’ll go back to controlling the First Person Camera again.

The problem is I can’t stop camera movement for the old first person camera, and I also can’t enable movement for the new door camera. The camera views do change properly, and I can move back and forth between the two cameras, I just can’t change the controls. I’ve managed to stop the player character movement, but the mouse keeps moving. If I completely disable input the character can’t use the interact button to exit the view.

Here’s what was left of the blueprint after I gave up trying to make it work; it’s an absolute mess, I can’t even remember what I was trying to accomplish here. I don’t understand control inputs. The tutorial needed Mouse X and Mouse Y nodes, but the BP_FirstPersonCharacter was using this Enhanced Input

Hey @fartificial!

Try using a simple Boolean to stop anything or enable anything you need to. Maybe when you switch to the keyhole, set a new bool, let’s call it “Camera Occupied” to TRUE (meaning the camera is occupied in some way other than normal movement).

Then take that bool, and do a branch on your mouse movement input for the camera, checking if “Camera Occupied” is true or false. On True, do one thing, on false do another.

Right now your code is stacking for two separate things. You’re using an enhanced input AND basic input, so you’re using the mouse inputs twice at the same time for different things. You need to either disable the IA_Look or stop using the MouseX/MouseY because they’re doing the same thing- the IA_Look is basically a combined MouseX/MouseY with extra options.

1 Like

That’s a great idea. I’ve managed to stop and start the First Person Player camera when I interact with the peephole object; for some reason though I can’t quite work out how to take control of the peephole camera still.