arashi2
1
pleas help me - don’t know how to write this code in C#
var follow :GameObject;
function LateUpdate ()
{
var cam = GetComponent("Camera");
if(cam != null)
{
if(follow)
{
cam.transform.position = Vector3(0,0,0); }}}
// sorry about the formatting, the 1010101 button isn’t working…
GameObject follow; // not assigned, will always be null
void LateUpdate()
{
Camera cam = gameObject.GetComponent() as Camera;
if(cam != null)
{
if(follow != null)
{
cam.transform.position = Vector3.zero;
// long-winded way
// cam.transform.position = new Vector3 (0.0F, 0.0F, 0.0F);
}
}
}