Blogger Information
Blog 95
fans 0
comment 11
visits 249426
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
摄像机与模型相对偏移量设置
龍__遇见彩虹的博客
Original
1881 people have browsed it

using UnityEngine;
using System.Collections;

/*
 * 摄像机与模型相对偏移量设置
 */

public class RoleOffset : MonoBehaviour {

    public Transform targetRoleTransform;
    private Vector3 offset;

    // Use this for initialization
    void Start()
    {
        offset = transform.position - targetRoleTransform.position;
    }

    // Update is called once per frame
    void Update()
    {
        transform.position = offset + targetRoleTransform.position;
    }
}

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post