Hello, so I am new to unity and I’m just messing around with code to try and learn.
I have a game object that and I would like to increase it’s size for example 5 seconds and return to the default size again.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour {
public float speed = 5f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown("s"))
transform.localScale = new Vector3(5, 5, 5);
}
}
and after 5 seconds i would like it to return to scale of 1,1,1
How would I do this? I’m guessing i use time.deltatime?