How do I deactivate a car with my script?

Hello everybody. Now, we can all get some playercars from unity site. Now, how do I actually make it so that when my car touches a bit of water, it deactivates so the player CANNOT move?

1 Answer

1

you should use Gameobject.setactive in appropriate function to set your gameobject (car) to set active or not active use this link for more info ----- > Gameobject.Setactive

Don’t forget to mark the answer if found useful…Enjoy…Cheers…