Advertisement
dronkowitz

TriangleJump.cs

Aug 30th, 2021 (edited)
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class TriangleJump : MonoBehaviour
  6. {
  7.     public bool triangleJump;
  8.     public bool isJumping;
  9.     // Start is called before the first frame update
  10.     void Start()
  11.     {
  12.        
  13.     }
  14.  
  15.     // Update is called once per frame
  16.     void Update()
  17.     {
  18.        
  19.     }
  20.     public void stick(GameObject speedCharacter)
  21.     {
  22.         NewPlayerMovement.controllable = false;
  23.         speedCharacter.GetComponent<Rigidbody>().useGravity = false;
  24.         speedCharacter.GetComponentInParent<NewPlayerMovement>().body.velocity = Vector3.zero;
  25.         speedCharacter.GetComponent<Animator>().Play("Triangle Jump");
  26.     }
  27.  
  28.     public void Jump()
  29.     {
  30.        
  31.     }
  32.     public IEnumerator WallJump()
  33.     {
  34.         yield return null;
  35.     }
  36.     public void OnTriggerEnter(Collider other)
  37.     {
  38.         if (other.GetComponent<CharacterAttack>().homingAttackUsed==true)
  39.         {
  40.             stick(other.gameObject);
  41.         }
  42.     }
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement