Hi.
What I am trying to do here is cast a spherecast just above my player to detect collision with ceillings and bounce back down. I used a raycast, but it didnt catch the sides and looked funny. Other then that the normal raycast worked fine.
var rayCastUpDist : float = 1.0;
function Update
var hit : RaycastHit;
if (Physics.SphereCast (transform.position, 1, transform.up, hit, rayCastUpDist ))
{
Debug.Log("Top Hit!!!");
// moveDirection.y -= gravity + 1 * Time.deltaTime;
}
There is more to the code but, didn’t want to add to much.
As of now, the ray cast is detecting and printing the debug log even when theres nothing above the player. Player starts in a position on the map with nothing above him.