- Home /
Object clipping through ceiling
My player object is clipping through a ceiling. See following gif: https://media.giphy.com/media/1ym5OnpKzcm1YB5j6N/giphy.gif
Player:
Cube: Player script:
public class CubeController : MonoBehaviour {
public float movementSpeed;
void FixedUpdate() {
float moveHorizontal = Input.GetAxis("Horizontal") * movementSpeed;
float moveVertical = Input.GetAxis("Vertical") * movementSpeed;
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
transform.Translate(movement);
}
}
How can I prevent the player from clipping through the object? (Sidenote the gravity seems to be really low. The standard -9.81 gravity should be a good starting point but it needs to be a lot higher for my case. Do I need to change something different?)
Answer by zakdank · Apr 29, 2018 at 07:01 AM
Will the platform be moving at all? If not then you shouldn't have a rigid body attached to it. I would remove that and see if it fixes the issue.
I already tried it. It won't fix the issue.
Your answer
Follow this Question
Related Questions
Is moving a collider without rigidbody bad? 1 Answer
Rigidbody Trigger 1 Answer
Collider with NavmeshAgent: Is it static? 0 Answers
Rigidbody goes crazy when isKinematic is false 1 Answer
[SOLVED] Object keeps sliding? 2 Answers