Added Node camera transitions

Fixed Conveyor speedup issue
This commit is contained in:
Jan Groß
2021-06-12 15:28:07 +02:00
parent 4ad82fe684
commit 759cf0a383
10 changed files with 228 additions and 32 deletions

View File

@@ -19,7 +19,11 @@ public class Conveyer : MonoBehaviour
foreach (ContactPoint contact in collision.contacts)
{
//Debug.Log(string.Format("Current Collider: {0} Position {1}", contact.otherCollider.name, contact.otherCollider.transform.position.magnitude));
contact.otherCollider.GetComponent<Rigidbody>().AddForce(transform.forward * (conveyerSpeed * direction), ForceMode.Acceleration);
if(contact.otherCollider.GetComponent<Rigidbody>().velocity.magnitude < conveyerSpeed)
{
contact.otherCollider.GetComponent<Rigidbody>().AddForce(transform.forward * (conveyerSpeed * direction), ForceMode.Acceleration);
}
}
}
}