Hello Unity Answers,
Currently I have a simple cube with a script attached allowing it to rotate, I was wanting to know how I could make some simple collision occur between the rotating cube and my character controller instead of it being able to walk through the cube.
Here’s my code so far:
var rotSpeed: float = 100; // degrees per second
transform.Rotate(0, rotSpeed * Time.deltaTime, 0, Space.World);
When you say you want a simple collision to occur, do you mean you want something to happen (player take damage for example) or just to have the player controller not be able to walk through the cube?
If you just want player to not be able to go through cube, make sure you have colliders attached to both the cube and the object that has the character controller component. (Furthermore, make sure isTrigger option is not checked on in either gameObject).
If you want something to occur, refer to the Unity Script Reference page