Can’t keep the position
Hi can’t keep the knives current position when setting the parent
private void OnTriggerEnter(Collider other)
{
transform.SetParent(other.transform);
rigidbody.velocity = Vector3.zero;
rigidbody.angularVelocity = Vector3.zero;
rigidbody.isKinematic = true;
rigidbody.useGravity = false;
myCollider.isTrigger = false;
anim.enabled = false;
if (other.transform.tag == "Enemy")
{
EnemyHealth e = other.transform.GetComponent<EnemyHealth>();
e.TakeDamage(damage);
}
else if (other.transform.tag == "TrainingDume")
{
TrainingDumeHealth e = other.transform.GetComponent<TrainingDumeHealth>();
e.TakeDamage(damage);
}
}
Comment