You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
658 B
C#
29 lines
658 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class GrappleAttachment : MonoBehaviour
|
|
{
|
|
public bool CollisionStuck;
|
|
public float ThrowForce = 20.0f;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
GetComponent<Rigidbody>().constraints = RigidbodyConstraints.None;
|
|
// GetComponent<Rigidbody>().AddForce(Vector3.forward * ThrowForce);
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
void OnCollisionStay()
|
|
{
|
|
CollisionStuck = true;
|
|
GetComponent<Rigidbody>().constraints = RigidbodyConstraints.FreezeAll;
|
|
}
|
|
}
|