mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
fixed bumper and boulder
fixed wallrun on regular player prefab
This commit is contained in:
@@ -13,14 +13,14 @@ public class Boulder : NetworkBehaviour
|
||||
}
|
||||
|
||||
void OnTriggerEnter(Collider other) {
|
||||
if (other.tag == "Player") {
|
||||
if (other.transform.parent.gameObject.tag == "Player") {
|
||||
GameObject player = other.gameObject;//Turns the collider into a game object
|
||||
Vector3 Dir = boulder.velocity;//Finds the bolder's velocity
|
||||
float Power = boulder.velocity.magnitude;// * 250;//Finds the power of the boulder by using it's velocity and a scaler
|
||||
Dir = Vector3.Normalize(Dir);//Normalizes the vector to be used as a knockback direction
|
||||
//Knock the player a little to the side
|
||||
Dir.z += Random.Range(-0.25f, 0.25f);
|
||||
player.GetComponent<dPlayerMovement>().GetHit(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed
|
||||
player.GetComponent<PlayerMovement>().GetHit(Dir, Power); //Ragdolls the player in the direction of the bolder depending on it's speed
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ public class Bumper : MonoBehaviour {
|
||||
|
||||
// Is called whenever something collides with the bumper
|
||||
void OnTriggerEnter(Collider objectHit) {
|
||||
if (objectHit.tag == "Player") {//Checks if the other object is the player
|
||||
|
||||
if (objectHit.transform.parent.gameObject.tag == "Player") {//Checks if the other object is the player
|
||||
PlayerMovement playerMovement = objectHit.GetComponent<PlayerMovement>();
|
||||
|
||||
float DirBumpX = playerMovement.driftVel.x * -1;//Inverts the Player Velocity x
|
||||
|
||||
Reference in New Issue
Block a user