|
|
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
-
- public class ExplosionTest : MonoBehaviour
- {
- [SerializeField]
- private float Force = 1;
-
- private void OnTriggerEnter(Collider other)
- {
- var horse = other.GetComponent<PlayerController>();
-
- if (horse != null)
- {
- Vector3 force = Vector3.up * 2 + Vector3.ProjectOnPlane(Random.insideUnitSphere, Vector3.up) * Force;
- horse.AddForce(force);
- Debug.DrawRay(horse.transform.position, force, Color.red, 1f);
- Debug.Log("Throwing horse");
- }
- }
- }
|