- Home /
Question by
MontyMomentum · Jul 01, 2020 at 04:15 PM ·
animationanimatorparameter
Player freezes at start of scene due to animator
My player has an Animator and to another object I've attached a scrip that would set the animation parameter to true. The controller has a default state and the transition has the correct parameter with Exit Time enabled.
Link to picture of my Animator: https://drive.google.com/file/d/1iqqRljh1L0nFovyr0D8HoQYHyXffvDke/view?usp=sharing
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayAnim : MonoBehaviour
{
[SerializeField] private Animator MyAnimationController;
public GameObject Player;
public string Parameter;
private void OnTriggerEnter(Collider other)
{
if (other.gameObject == Player)
{
Debug.Log("Animation start");
MyAnimationController.SetBool(Parameter, true);
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Parameter does not exist 3 Answers
Replacing an animation with another one 0 Answers
2D Animation does not start 1 Answer
Animation does not play in full motion. 1 Answer
Playing An Animation At A Certain Point Based On Mouse Position 0 Answers