Rigidbody Character falling through the floor

Hi,

I’m a little new…ish to unity so bear with me. Simply put, when my character has a rigidbody attached, he falls through the floor. It is a custom mesh built in blender, with a collision mesh attached. I am using the following code as my my character controller:

if (Input.GetKey(“w”))
{
transform.position.z = transform.position.z + 1;
}

The other axis of motion are basically coded the same. Any ideas what I’m doing wrong?

Thanks a bunch

FYI: I’m not quite sure if this belongs in the scripting section, but I didn’t know where else to put it.

Directly modifying the transform.position will not take into account the collision system. Think of that as a direct teleport; meaning it will go through colliders. You should be using the AddForce or MovePosition functions.

OK Got that. How do I use the rigidbody.MovePosition in this case. Thanks a bunch