Question by
ethanol3310 · May 25, 2018 at 09:46 AM ·
transformrespawndeath
Can someone fix this code for a death script please
private Rigidbody rb;
public Transform spawnPoint;
public GameObject player;
private GameObject other;
public bool freezeRotation;
public GameObject gamObject;
public object GameObject { get; private set; }
void Awake()
{
rb = this.GetComponent<Rigidbody>();
}
void FixedUpdate()
{
if (Input.GetKey("d"))
{
rb.AddForce(0 * Time.fixedDeltaTime, 0, 0);
}
if (Input.GetKey("a"))
{
rb.AddForce(-0 * Time.deltaTime, 0, 0);
rb.angularVelocity = Vector3.zero;
}
if (other == null)
other = UnityEngine.GameObject.FindWithTag("lethal");
{
GameObject.transform.position = spawnPoint.position;
}
}
}
Comment