I have a problem with collision detection.
I have my character, he is moving to the z axis automatically.
I have some columns and i want to detect collision with the character…but nothing happens.
Character Movement Script(JS):
function speed_up(){
for(var i = 0; i < 200; i++){
yield WaitForSeconds (10);
if(speed < 9){
speed = speed + 0.3 ;
InvokeRepeating("speed_up", 0, 2);
can_speed = false;}else{return;}
}
}
Collision Script:
function OnCollisionEnter(collision: Collision) {
Debug.Log("LOST");
if (collision.gameObject.tag == "Block"){
DefeatText.active = true;
Time.timeScale = 0;
Debug.Log("LOST");
}
}
The Column :
The Character :
TRIED ALSO WITH RIGIDBODY Nothing Happened
Thank you so much for your time!

