Aside from one issue with the waypoint the waypoint race scene is working as intended

This commit is contained in:
Gregory Campbell
2020-01-14 22:01:39 -05:00
parent 9e71153754
commit 11d9698aad
11 changed files with 1097 additions and 17 deletions
+35
View File
@@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Waypoint : MonoBehaviour
{
public bool isGrounded;
// Start is called before the first frame update
void Start()
{
isGrounded = false;
}
// Update is called once per frame
void Update()
{
isGrounded = grounded();
Debug.Log(isGrounded);
}
bool grounded()
{
RaycastHit hit;
if(Physics.Raycast(transform.position, transform.TransformDirection(Vector3.down), out hit, 1.0f))
{
return true;
}
return false;
}
}