1
0
mirror of https://projects.caleb-brown.dev/UDRI-XRT/UDRIGEEKCup2024.git synced 2025-01-22 07:08:51 -05:00
UDRIGEEKCup2024/Assets/Scripts/BoostBall.cs

24 lines
628 B
C#
Raw Normal View History

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
{
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))
{
Log.Debug(ForceDirection.forward.normalized*ForceScale);
rigidbody.AddForce(ForceDirection.forward.normalized*ForceScale, ForceMode.Impulse);
}
}
}
}