23 lines
629 B
C#
23 lines
629 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class GrabbableCrank : MonoBehaviour
|
|
{
|
|
public Transform Handler;
|
|
|
|
public void ReleaseCrank()
|
|
{
|
|
transform.position = Handler.transform.position;
|
|
transform.rotation = Handler.transform.rotation;
|
|
|
|
Rigidbody rbHandler = Handler.GetComponent<Rigidbody>();
|
|
rbHandler.velocity = Vector3.zero;
|
|
rbHandler.angularVelocity = Vector3.zero;
|
|
|
|
AudioSource cranking = GameObject.Find("SFX/Cranking").GetComponent<AudioSource>();
|
|
if (cranking.isPlaying)
|
|
cranking.Stop();
|
|
}
|
|
}
|