Unity3D Tutorial Smooth Look At

Advertisemen

Unity3D Tutorial Smooth Look  At

Easter video series !













THIS IS Java# script: GOOD 4 2D GAMES AND 3D GAMES !
----------------------------------------­­­­­­­----------------------------------­-­-­-­-­-­-­------

DIRECT DOWNLOAD HERE




THIS IS BACKUP  IN TEXT FORM  TUTORIAL Smooth Look  At

1. Create New java and name it : SmoothLookAt


2. Copy & Past this text and save java :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-


var target : Transform;
var damping = 6.0;
var smooth = true;

@script AddComponentMenu("Camera-Control/Smooth Look At")

function LateUpdate () {
if (target) {
if (smooth)
{
// Look at and dampen the rotation
var rotation = Quaternion.LookRotation(target.position - transform.position);
transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * damping);
}
else
{
// Just lookat
   transform.LookAt(target);
}
}
}

function Start () {
// Make the rigid body not change rotation
    if (rigidbody)
rigidbody.freezeRotation = true;
}







 ----------------------------------------­­­­­------------------------------------­-­-­-­-­-

Advertisemen

Disclaimer: Gambar, artikel ataupun video yang ada di web ini terkadang berasal dari berbagai sumber media lain. Hak Cipta sepenuhnya dipegang oleh sumber tersebut. Jika ada masalah terkait hal ini, Anda dapat menghubungi kami disini.

Tidak ada komentar:

Posting Komentar

© Copyright 2017 Tutorial Unity 3D