Hello, I am very new to scripting and I would like to code a script for where an image would appear after a certain amount of seconds. Ho may I do this?
There’s many ways to do this but I think you’ll need to first spend some time learning the basics of Unity. Then once you know how to create and edit scripts then you’ll be able to use a script like this:
using UnityEngine;
public class ShowImage : MonoBehaviour
{
public Texture image; // Drag an image/texture onto this in the editor
void OnGUI()
{
if (Time.time>3) // show the image after 3 seconds has passed
GUI.DrawTexture(new Rect(0, 0, 200, 200), image, ScaleMode.ScaleToFit);
}
}
This is a very old way of placing something onto the screen but it’s still probably the simplest method.
Another simple method would be to parent a textured Quad object to the camera and enable it with a script after a period of time using the Invoke method.
Why not just make an animation that turns the image off at time ==0 and then at time == whatever turns it on?
Don’t write code if you don’t need to.