I am trying to access the code through it name,but i am unable can u suggest how i can set the name object and access through code…
using UnityEngine;
using System.Collections;
public class practice : MonoBehaviour {
public Vector3 newpos;
public float k =-2844.5f;
Vector3 posVector;
public bool show = false;
public GameObject PlayButton;
// Use this for initialization
void Start () {
newpos = transform.position;
print("newpos x "+newpos.x+"y "+newpos.y+"z "+newpos.z);
}
// Update is called once per frame
void Update () {
PlayButton.newpos.x += 20.5f;
k +=20.5f;
if(!show)
{
movement();
}
}
void movement()
{
if(k <-1402.9739f)
{
transform.position= newpos;
// transform.position = Vector3.Lerp(currpos, newpos, Time.time);
}
else if(k >= -1402.9739f)
{
show = true;
}
}
}