- Home /
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 ?
Answer by ariok · Aug 30, 2011 at 04:07 PM
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 :) it works and i can use onCollisionEnter to get information about collision.
Your answer
Follow this Question
Related Questions
Destroying object when player walks over it 1 Answer
Animation freezes on TriggerStay2D 0 Answers
Can't crash airplane into ground 4 Answers
Player rotating after wall collision 1 Answer
Best way to ignore y component for certain collisions? 1 Answer