2024-04-19 07:58:54 -04:00
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using Unity.Logging;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace MAVRIC.GEEKCup
|
|
|
|
{
|
|
|
|
public class BoostBall : MonoBehaviour
|
|
|
|
{
|
2024-04-19 08:10:17 -04:00
|
|
|
public Transform forceDirection;
|
|
|
|
public float forceScale = 1f;
|
2024-04-19 08:03:41 -04:00
|
|
|
|
2024-04-19 07:58:54 -04:00
|
|
|
private void OnTriggerEnter(Collider other)
|
|
|
|
{
|
|
|
|
if (other.gameObject.TryGetComponent(out Rigidbody rigidbody))
|
|
|
|
{
|
2024-04-19 08:50:04 -04:00
|
|
|
rigidbody.AddForce(forceDirection.forward.normalized*forceScale, ForceMode.Impulse);
|
2024-04-19 07:58:54 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|