hi everyone how can i destroy a odject when my player hit it
Destroy(gameObject.Find(“objectname”)); Try this
ControllerColliderHit is used when a Controller hits something. If your game object isn’t a controller it wont work.
So what your saying there is if the person the user is controlling hits something named “player”, destroy the game object in the scene named floor.
if your controller and player are the same thing, that might be bad.
another thing, unless you are specifically using a tag, make the call hit.gameObject.name == “player”
What are your two objects that are supposed to be colliding?