Demo entry 6354697

camera

   

Submitted by zjh on Apr 10, 2017 at 13:31
Language: C#. Code size: 525 Bytes.

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

public class CameraFollow : MonoBehaviour
{

    private Transform m_Transform;
    private Transform player_Transform;

    void Start()
    {
        m_Transform = gameObject.GetComponent<Transform>();
        player_Transform = GameObject.FindGameObjectWithTag("Player").GetComponent<Transform>();
    }

    void Update()
    {
        m_Transform.position = player_Transform.position + new Vector3(5, 10, -10);
    }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).