Scripting games like PokemonSnap

Me and a few people are making a game like PokemonSnap, but we don’t know how to script the cameras. We either want it just like PokemonSnaps camera or have it so there is a camera box in the middle of the screen that changes from red to green once you are facing a target, then take the picture that just raises you score. We are all new to Unity and scripting. Does anyone know what we could do?

Create an cam. Create an new UI Element. Send an raycast and if target hit, change sprite or color of the ui. Than call your camera shooting function and raise score variable.

If you wish for something quick noob-friendly, I would suggest this :

- Camera Controls :
Search for a tutorial about how to script a FPS camera online. You will learn a lot about how inputs works in Unity.
You just have to use the X and Y mouse axis and no need for any movement controls (unless you wish to allow your player to move in the area by themselves, but since you mention Pokemon Snap, you must mean it’s a game with “on tracks” movement)

- On Track Movements :
This is actually really easy to do and you don’t need to do anything outside of Unity for it.
You just have to use the Unity Animation (CTRL+6) and create each “track roads” with an empty object. You should create each track in a separate animation. This will allow you to set up multiple possible tracks if you wish for the player to be able to search for hidden content/roads. (In Pokemon Snap, you were able to uses apples and a sleeping agent if I’m not wrong and using them at some area or on some pokemon opened new roads in each maps)
With each animation file you create with the Animation menu, you can use the animator and actually set those movement with simple integer (int) values. For example, you have the start animation. Then you have 1 default road with an int value at 0. If the player does the right thing at the right time, the int is increased to 1 and this activate the hidden road while the player’s movement move toward the hidden track.

- Throw items :
This might be a bit hard for anyone new to unity, but still quite possible. Search for Instantiate and “grenade” related tutorial online for Unity. This will give you the minimum amount of script knowledge to make the player able to throw things. As for the effect of the item… that depend on how “deep” you wish to move. Deeper = more complex.

- Menus :
There are plenty of Tutorial around for the menus. All you need is a basic main menu and maybe learn how to create an option menu. It’s a bit complex, but it will allow you to understand how to store data easily. You can create a simple list of map (a list of button which each load a different scene).

- Maps :
Each map should be its own scene unless you want to script something more complex like multiple spawn locations in a scene. You will mostly have to create a basic version of each map before animating the track movements. This also means you will have to do 3D modeling or buy stuff online.

Watch out if you plan to use free stuff online. There’s a LOT of stuff that are free only for non-commercial uses. This remove you the right to use them on any commercial distributors like Steam even if you give it out free. (It’s part of Steams agreement contract with the devs) At the same time, you can use those as temporary assets/fillers as long as it’s not in the finished product.

Also, most of the free stuff online won’t include animations or even any rigging and you need to do those yourself.

- GUI :
It should be relatively simple to add your camera details within the GUI. You just have to make it so that a raycast from the camera is constantly sent and whenever it hit a collider of an object with a specific Tag, the GUI texture changes.

using UnityEngine;
using System.Collections;

public class ExampleScript : MonoBehaviour {
    public Texture2D AimTexNoPok;
    public Texture2D AimTexOnPok;

    private Camera cam;
    private float TextureSize = 100;
    private float CameraRange = 500;
    private Texture2D ActiveAimTexture ;
    private float

    void Awake(){
        cam = Camera.Main;
    }

    void Update(){
        if(Physics.Raycast (cam.transform.position, cam.transform.forward, hit, CameraRange))
                if(hit.tag = "Pokemon"){
                ActiveAimTexture = AimTexOnPok;
            }
            else{
                ActiveAimTexture = AimTexNoPok;
            }
        }
    }
    void OnGUI(){
        GUI.DrawTexture(new rect((screen.width * 0.5f) - (TextureSize *0.5f), (screen.height * 0.5f) - (TextureSize *0.5f), TextureSize, TextureSize), ActiveAimTexture);
    }
}

This is a quick example which you can place on an empty gameobject in your map scene.
The camera which have “MainCamera” as tag will automatically be found and used when the scene is loaded. Then whenever the camera point on anything with the tag “Pokemon”, the texture switch from the AimTexNoPok to AimTexOnPok. The GUI.DrawTexture will ensure the camera’s texture is always centered.
All you got to do with this is add both textures (AimTexNoPok and AimTexOnPok) whenever it’s on or off a pokemon (or whatever you wish to aim at).

Change the 100 next to TextureSize to select how many pixels the texture should take in the screen.
Change the 500 next to CameraRange to select what range your wish the camera to recognize what it’s aiming at. I suggest this to also limit the ray length from the camera. (If you wish to have no “limit”, just set it to something like 1000 if, in-game, 1 unit = 1 meter. This should allow you to make the camera work over 1km which is far considering the screen width)

It’s incomplete as it only includes the stuff to get the middle texture (camera scope/texture), but it’s a good beginning to start from. With a little studies on how to make events happens, you can do pretty much the whole game like this.

Hope this launch you on the right direction.
Good luck!