How to change cameras and controls when interacting with an object?

Hello everyone !

I’ve been trying to make a class bluprint for a deus ex type keypad, for training purposes…but I got stuck when trying to actually interact with the thing…

I would like to change the camera so it focuses on the object itself, so I tried various methods, including that https://answers.unrealengine.com/questions/39116/switching-between-multiple-cameras-in-blueprints.html but the Set view node is not even present in my actor class BP, I only saw it in a character BP (maybe I need to script that in the character and reference it in the object though …).

I also want to pause the character when I’m interacting with the keypad and be able to punch in codes and stick a user interface on it…but still haven’t found answers about that either.

Has anyone ever tackled this type of interactive objects and could share some tips and tricks ?

Thank you !

to pause the character, use setCinematicMode().

to set the camera up, inside the pickup, you can cast from the overlapped actor to a pawn, then get its controller, cast it to your custom player controller, and dragging from a player controller node should give you access to setViewTargetFromBlend().

if you make a custom movement component for your character, you can add a custom movement state. instead of walking, swimming, or flying, this movement state could be called “keypadding”, and it would be used to connect input events to blend nodes in the character’s animBlueprint.

wow cool thanks for your answer i’ll try this today ! :slight_smile:

Can you post a screenshot? I get lost in how to setup the camera…

Hey I’ve been fiddling again with the anim BP of my keypad…I had made it so it had 4 states (closed; opening to open, etc), and set the variables properly and all. Problem is : I haven’t found a way to use that state machine properly…so I resorted to a simple “play anim” in the actual actor BP of the keypad…which I guess is kind of a failure. I’ve looped all the unreal videos regarding character animation but haven’t found my answer there, so my question now is : is there a way to actually control the states in the anim BP inside of the keypad bluprint ? Ideally I wanted to set the starting state; change de state manually via script, link an input event “On interacted” in the the anim BP’s eventgraph…none of these possibilities were available, so i got pretty must lost :slight_smile: it’s probably not how it works there?

If you have some infos about this, I’d appreciate that a lot :slight_smile: thanks ! I’ll keep digging on my side, your first solution Omnicypher is very interesting already :slight_smile:

Does the keypad itself needs to be a character BP ? It’s still an actor BP right and the set view target with blend does not accept the camera component from the BP itself :frowning: I guess it would only work in a level BP; which is not reusable so not really what i want…but from what you said I guess I should consider the keypad as part of the character or a separate character?

I’ve managed to set the viewpoint to the keypad by changing my hierarchy (camera component is now the root so i can do a reference to self as indicated by this thread How do i change main camera to blueprint camera - Cinematics & Media - Unreal Engine Forums) . As I commented there, I find this strange that swapping cameras is not …simpler? Well anyway, i’m just getting started :slight_smile: someday this might make sense