24 lines
507 B
C#
24 lines
507 B
C#
|
|
using Unity.VisualScripting;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class Tipper : MonoBehaviour
|
||
|
|
{
|
||
|
|
Rigidbody rb;
|
||
|
|
[SerializeField] float forceAmount = 10f;
|
||
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||
|
|
void Start()
|
||
|
|
{
|
||
|
|
rb = GetComponent<Rigidbody>();
|
||
|
|
}
|
||
|
|
|
||
|
|
// Update is called once per frame
|
||
|
|
void Update()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
public void TipObject()
|
||
|
|
{
|
||
|
|
rb.AddTorque(transform.forward * forceAmount, ForceMode.Impulse);
|
||
|
|
}
|
||
|
|
}
|