Hello.
In my game, I can "shoot" balls with instantiate function in the script, that is attached to my Character Controller.
To Character Controller is attached another script, which Im trying to use to check if the ball hit the player. I have 2 versions, but they dont work. I think its because of I can do this check only to original Ball and not to its copies. But I dont know how to access them :(
First:
void OnControllerColliderHit(ControllerColliderHit hit) {
if(hit.gameObject.name == "Gule")
print("trolololololl");
}
Second:
public Transform Gule;
void OnControllerColliderHit(ControllerColliderHit hit) {
if(hit.gameObject == Gule)
print("trolololololl");
}
Thank you for your ideas! Erhan