Random Idea with Handheld camera, or CCTV Camera

it could be cool to use the CCTV camera or the Handheld camera for maybe a finishing move or a special move or special spell … or maybe if the player gets poisoned and so then the camera is all shakey

turn it on with script like

GameObject handheldCam;
handheldCam.SetActive(true);

or maybe its :stuck_out_tongue:

handheldCam.enabled = true;
1 Like

@GameDev_Sorcery, I like the idea of switching between cameras for different situations. I don’t have much game dev experience, so would you envision this being configured per-scene or have some global game flags and a camera control system at the game-level which switches between cams for different situations and tweaking the individual camera settings?

I can see the swaying of the handheld camera being very useful when poisoned, as you had mentioned, but then also for a particular cutscene with a different amount of sway.

1 Like

I followed the idea, placed the MultipurposeCameraRig into the scene, together with my Camera Arm object, and changed the CameraController, attached to Camera Arm like the following:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraController : MonoBehaviour {
private Transform playerTransform;
private Transform monsterTransform;

private GameObject movementCamera;
private GameObject combatCamera;

[SerializeField]
private float distanceToSwitch = 50.0f;

void Start() {
playerTransform = GameObject.FindGameObjectWithTag(“Player”).transform;
monsterTransform = GameObject.FindGameObjectWithTag(“Monster”).transform; //what if there are more monsters?

  movementCamera = GameObject.FindGameObjectWithTag("MainCamera");
  combatCamera = GameObject.FindGameObjectWithTag("CombatCamera");

}

void LateUpdate () {
transform.position = playerTransform.position;

  if (Vector3.Distance(playerTransform.position, monsterTransform.position) < distanceToSwitch) {
  	movementCamera.SetActive(false);
  	combatCamera.SetActive(true);
  } else {
  	movementCamera.SetActive(true);
  	combatCamera.SetActive(false);
  }

}
}

PS: don’t forget to update the tags

the result seems nice!

2 Likes

Privacy & Terms