holas el problema que tengo es que cuando el personaje esta dentro de un gameObject la animación no funciona osea si coloco el animador directamente sobre el jugador funciona pero si coloco el jugador dentro de un gameObejct y pongo al gameobject el animador no funciona la animacion
English speaking forum here…
Anything with Animations / Animators / Mechanim:
Only consider the code AFTER you have done this critical step:
Always start with the Animator state machine and prove it works in isolation, no code at all.
Here’s more reading:
Hello, thank you. Look, I’ll explain to you, if I put the animator to the “gameObject” and the “player” enters the “gameObject”, the animation does not work. but if I put the animator on “player” there it works
Sounds like you wrote a bug… and that means… time to start debugging!
By debugging you can find out exactly what your program is doing so you can fix it.
Use the above techniques to get the information you need in order to reason about what the problem is.
You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.
Once you understand what the problem is, you may begin to reason about a solution to the problem.
“player” inside the “gameObject” animation does not work
Look, it’s not a mistake.
look at the code
emphasized text*using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class anim : MonoBehaviour
{
public Animator animation;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
animation.SetBool("IsMoving", true);
}
}
watch the video
a rabbit is outside the “gameobject”
the other is in the “gameObject”.
The difference is that the animator is in the “gameObject”
That is not how problems are solved.
You are going to solve the problem by debugging.
I have told you all the debugging steps necessary above.
The sooner you begin debugging, the sooner you will figure out the problem.