Inspiré par ce petit tuto:
https://www.youtube.com/watch?v=Unkj6QDhC1s
j'ai à peu près copié le script du tuto qui ne fonctionne pas:pourquoi?
Code : Tout sélectionner
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class Timer : MonoBehaviour
{
float time,tick;
public float TimeInterval=5f;
void Awake()
{
time=Time.time;
tick=TimeInterval;
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
time=Time.time;
if (time==tick)
{
tick=time+TimeInterval;
print("hello");
}
}
}
J'espérais que hello s'affiche tous les TimeInterval
merci de votre aide