Locking player and controlling another camera

Hey all.

I’m working on a new weapon for my game and wanted to get some feedback on my initial thoughts of how to implement it.

When you “fire” the weapon, it is supposed to deactivate player input and instead it should funnel input into a fixed position camera (so that the input can rotate it), the camera should render to a texture so that the texture can be used on the weapon itself. Think of it like an endoscope or something.

So my questions:

  1. How to disable player movement, whilst still allowing player input? I’m using shootergame, so I’m assuming there’s some method of disabling movement at least.
  2. How do you transfer input to another actor (the camera) whilst still allowing input for the weapon so that you can stop using the weapon and delete the camera
  3. How to funnel the camera render texture to the weapon material

Any help with these things would be super useful.

As a follow up to this. I just wondered, is there a default raycast that I can hook for seeing whats under my view? Or should I implement my own. It seems wasteful if one is already being fired (for instance for highlighting things at the cursor in-game etc).

Just curious.