Player movement and simple collision

Hi! i have a really simple scenario :

  • A cube (the player) with assigned a simple script that takes input from keyboard to move the cube
  • Another cube on which the player might collide.
  • A surface over the 2 cube are placed

Every cube has a cube collider… so i suppose that when the 2 cubes collide the player one’s must stop over the other cube. With my surprise the player pass through the other cubes as it is transparent.

What i must do to create a simple environment with a player that collide over cubes ?

1 Answer

1

I found the error
I didn’t attach a rigid body to the player. I also add constrain over X,Y and Z to avoid unwelcome rotations after a collision :slight_smile: it works and i can use onCollisionEnter to get information about collision.