Forum rules - please read before posting.

implementing 'limit to camera' for spawned item

In my game (first person), I've been using the 'limit to camera' for all hotspots.

I now have an item that is spawned from the inventory into the scene, using a marker (https://adventurecreator.org/tutorials/dropping-items) & I'm not sure how to implement this (probably from an actionlist ?).

Tips are much appreciated ! :)

Comments

  • First-person as in a standard first-person camera control type? Unless you're using e.g. close-ups for specific moments, you generally only use the one camera type.

    To set the field at runtime, you need a custom script. This one will set the attached Hotspot to the first-person camera, but it'll need tweaking if you're using something else:

    using UnityEngine;
    using AC;
    
    public class LimitToFirstPersonCamera : MonoBehaviour
    {
    
        void Awake ()
        {
            GetComponent<Hotspot> ().limitToCamera = KickStarter.player.FirstPersonCameraComponent;
        }
    
    }
    
  • Thank you, Chris.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.