Complete C# Unity Game Developer 3D - Section 2 V25

I have added and followed the same code structure as I mentioned in the video Section 2: V25, however, i am facing an issue. As per the video, the object should disappear and stay in the air when the game starts and after 3s it should appear and drop to the ground, but in my case, it is disappearing from the start and appears after the 3s when it hits the ground, i tried to write the same code couple of times and repeat the process, but still it does not work,

If you dont use { } curly brackets with an if statement, it only works for the line right after.
Put it like this;

if(Time.time > timeToWait)
{
 renderer.enabled = true;
 rigidbody.useGravity = true;
}

Thank you so much. Now its working.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms