StaticSceneCollider.cs 464 B

12345678910111213141516171819202122232425
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class StaticSceneCollider : MonoBehaviour
  5. {
  6. // Start is called before the first frame update
  7. void Start()
  8. {
  9. }
  10. // Update is called once per frame
  11. void Update()
  12. {
  13. }
  14. void OnTriggerEnter(Collider other)
  15. {
  16. Rigidbody rb = other.gameObject.GetComponent<Rigidbody>();
  17. rb.velocity = new Vector3();
  18. rb.Sleep();
  19. }
  20. }