Can't collide with terrain

Just spent three days trying to get a simple boat working. Finally got it to move and carry me pretty much the way I want by scrapping physics and using a kinematic rigid body. But now I ran into another problem - it won’t collide with the terrain but just continues on under it. I have searched for an answer but the only thing I could find suggested I put a character controller on. I tried this but now I am back to square one - my boat is going sideways and I still can’t get collision to work. I know this isn’t a very good question but I am just getting so frustrated I’m hoping someone can help me.

Something like transform.Translate(0,0,1) is similar to you dragging the object in Scene mode. It moves it without checking whether the new spot is “legal” (not inside something else, or underground.) Likewise, transform.position+=moveDir; will tunnel through other objects.

You can manually check the ground level with:

y = Terrain.activeTerrain.SampleHeight(transform.position);
// Set my y to groundHt in C#:
Vector3 pos = transform.position;
pos.y = y; // set to ground HT
transform.position = pos;

If you want the system to check collisions for you, there are two options: Use a (non-kinematic) RB and set velocity: rigidbody.velocity = transform.forwards*20;. That won’t do anything right away, but the physics step will attempt to move at that speed. Speed is in meters/sec. Can also use AddForce and things like that, to preserve momentum.

Option 2: Use a char controller with controller.Move(xyzMovement);. That moves you right away, but checks right then for collisions.

The difference is that charControllers don’t push anything, and things bouncing off them don’t push it. RBs will push other objects out of the way, and with a little work can be shoved by other objects.