mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-03-27 12:14:46 -05:00
Implemented Ragdoll kinda There are some issues with getting hit while ragdolling that need to be fixed Adjusted Dash Dash still needs some adjustments before being fully implemented
26 lines
613 B
C#
26 lines
613 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Kick : MonoBehaviour
|
|
{
|
|
private float kickForce = 50f;
|
|
// Start is called before the first frame update
|
|
void Start(){
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update(){
|
|
|
|
}
|
|
|
|
private void OnCollisionEnter(Collision collision)
|
|
{
|
|
if (collision.transform.CompareTag("kickable")){
|
|
Vector3 direction = this.transform.forward;
|
|
Debug.Log(direction);
|
|
collision.rigidbody.AddForce(direction * kickForce, ForceMode.Impulse);
|
|
}
|
|
}
|
|
}
|