progress is steady but it is a bumpy road. I have removed the animation script from my character and reworked it into the controller script. I have also added new animations. Doing this required replacing the character FBX I was using earlier.
Doing this has caused an unexpected problem: Remember that super-cool item box that I made, that the character can trigger when he jumps under it, causing it to play an animation where the lid pops off? Well, that's broken now. The box's idle animation still plays, but the GetItem animation does not. Before importing the new character, his animations and the box's animations were in the same animation controller. I separated them into their own controllers, and applied them each where they belong. I did not make any more changes ( you can see all its properties in the demos below). There are still no transitions or parameters for the ItemBox. Funny enough, I tested it and the ItemBox's trigger is being activated. What could be wrong?
Video links (SHORT):
Link to video of new character demo
Link to Animators Panels Video
How can I get the GetItem animation to play for my itemBox again?
whoops, here is the relevant script:
ItemBox.cs:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ItemBox : MonoBehaviour
{
// Start is called before the first frame update
bool disabled = false;
Animator anim;
void Start()
{
anim = GetComponentInChildren<Animator>();
if (!disabled)
{
anim.Play("ItemBox_Idle");
}
}
// Update is called once per frame
void Update()
{
}
void OnTriggerEnter (Collider other)
{
if (!disabled && other.gameObject.tag == "Player")
{
print("itembox triggered");
anim.Play("ItemBox_GetItem");
disabled = true;
}
}
}
**This is the heirarchy for the ItemBox prefab. Notice that animation frames can only be seen from first child ("Parent") of that prefab, downward: **
UPDATE! GetItem animation is playing in the animation graph while I play the game, hitting the box from below, but the animation doesn't play in the game! The plot thickens! See (shorter) video: