mirror of
https://projects.caleb-brown.dev/UDRI-XRT/UDRIGEEKCup2024.git
synced 2025-01-22 07:08:51 -05:00
23 lines
555 B
C#
23 lines
555 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Unity.Logging;
|
|
using UnityEngine;
|
|
|
|
namespace MAVRIC.GEEKCup
|
|
{
|
|
public class BoostBall : MonoBehaviour
|
|
{
|
|
public Transform forceDirection;
|
|
public float forceScale = 1f;
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other.gameObject.TryGetComponent(out Rigidbody rigidbody))
|
|
{
|
|
rigidbody.AddForce(forceDirection.forward.normalized*forceScale, ForceMode.Impulse);
|
|
}
|
|
}
|
|
}
|
|
}
|