private void Idle() { GameObject[] checkObj = IR.CheckState(1); if (checkObj != null) { if (checkObj[0].tag == "Player") { Player = checkObj[0]; } } if (Player != null) { active = true; } if (active) { RigidbodyMovement RBM = Player.GetComponent <RigidbodyMovement>(); CharacterControllerMovement CCM = Player.GetComponent <CharacterControllerMovement>(); if (RBM != null) { RBM.enabled = false; Destroy(RBM.gameObject.GetComponent <Rigidbody>()); } else if (CCM != null) { CCM.enabled = false; CCM.gameObject.GetComponent <CharacterController>().enabled = false; } Player.transform.position = PlayerSeat.position; Player.transform.rotation = PlayerSeat.rotation; } }
public static void RotationToDirection(RigidbodyMovement movement, Vector2 direction, RangedFloat applicationPeriod, float rotationSpeed = 0.3f) { //Vector2 destination = Vector2.Lerp(inputHolder.directionInput, direction, trackFactor); //movement.atExternalRotation = false; //if (applicationPeriod.InRange(animationTime)) //movement.ApplyExternalRotation(destination, rotationSpeed); }
private void Awake() { #region Getting rbMove = GetComponent <RigidbodyMovement>(); animManager = GetComponent <AnimationManager>(); groundCheck = transform.Find("Ground Check"); #endregion }
private void Start() { rigidbody = GetComponent <Rigidbody2D>(); movement = GetComponent <RigidbodyMovement>(); inputHolder = GetComponent <InputHolder>(); animator = GetComponent <Animator>(); health = GetComponent <HealthController>(); if (weapon) { weapon.InitCharacterStateController(this); } }
private void Start() { movement = GetComponent <RigidbodyMovement>(); }