Quantcast
Channel: Questions in topic: "clone"
Viewing all articles
Browse latest Browse all 508

How to follow clone object with camera.

$
0
0
I am trying to figure out how to make my camera follow a cloned prefab, but to no avail. Is there something I should add to the code to help it find cloned objects? using UnityEngine; using System.Collections; using ORKFramework; public class CameraFollow : MonoBehaviour { public Transform target; public float m_speed = 0.1f; Camera mycam; // Use this for initialization void Start () { mycam =GetComponent (); } // Update is called once per frame void Update () { mycam.orthographicSize = (Screen.height / 2f) / 1f; if (target) { transform.position = Vector3.Lerp (transform.position, target.position, m_speed) + new Vector3 (0, 0, -10); } } }

Viewing all articles
Browse latest Browse all 508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>