Answer the question
In order to leave comments, you need to log in
Script interaction with other objects in unity?
GameObject respawn;
ParticleSystem ps;
void Start() {
gb = GetComponent<Transform>();
camera1 = Camera.main;
camera2 = GetComponent<Camera>();
camera2.enabled = false;
camera1.enabled = true;
respawn = GameObject.FindGameObjectWithTag("Respawn");
ParticleSystem ps = (ParticleSystem)respawn.GetComponent(typeof(ParticleSystem));
}
void Update() {
if (Input.GetMouseButton(0) && gb.transform.rotation.x != 180 && gb.transform.rotation.y != 90)
{
gb.LookAt(Input.mousePosition);
gb.Rotate(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0f),0f,Space.World);
ps.transform.position = Input.mouseScrollDelta;
ps.Play();
}
ParticleSystem ps = (ParticleSystem)respawn.GetComponent(typeof(ParticleSystem));
GameObject respawn = GameObject.FindGameObjectWithTag("Respawn");
ps.transform.position = Input.mouseScrollDelta;
ParticleSystem ps = (ParticleSystem)respawn.GetComponent(typeof(ParticleSystem));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question