Hi guys, I am recently do a seminar about Unity3D. I was excited about it when i realized that it’s a total crap one. I should have paid for the official Unity Certification. Anyway, what i am doing is to follow the instructor’s notices where i figure out that everything is outdated. At the moment I do the part of the animation, where with coding, you can control which animation you can play. So in his notices, he is using the command:
if (!animation.isPlaying)
which it was wrong obviously, because after some digging, I found out that this line is outdated. I replace it with the
if (!GetComponent())
My issue now that inside the if, there is another if which uses the wrong command to play the animation. So I am trying to figure out what should I change to make my code working. Below there is my code which needs the changes:
private void EnemyMovement()
{
if (!GetComponent())
{
SecondsToLaunch += Time.deltaTime;
if (SecondsToLaunch > LaunchCD)
{
animation.Play();
}
}
else
{
}
}
Before someone pops up and tell me “why you dont ask your assigned tutor about your issue”, I did and he told me “yeah, you are right, the command line is outdated, use the one that you mentioned” without telling me how to correct the whole part.
Any help will be appreciated.