Initial commit
This commit is contained in:
20
Assets/Scripts/Swing.cs
Normal file
20
Assets/Scripts/Swing.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Swing : MonoBehaviour
|
||||
{
|
||||
private Rigidbody _rb;
|
||||
[SerializeField] private float torque = 30f;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
_rb = GetComponent<Rigidbody>();
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
_rb.WakeUp();
|
||||
_rb.AddTorque(transform.right * torque, ForceMode.Impulse);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user