Fix World Camera
This commit is contained in:
@@ -13,12 +13,6 @@ namespace Scampz.GameJam.Assets.Scripts
|
||||
|
||||
private float currentHitDistance;
|
||||
|
||||
//public bool IsWithinBounds()
|
||||
//{
|
||||
// var offsetAngle = Quaternion.AngleAxis(rayCastAngle, transform.right);
|
||||
// return Physics.Raycast(transform.position, offsetAngle * transform.forward);
|
||||
//}
|
||||
|
||||
public bool IsWithinBounds()
|
||||
{
|
||||
var offsetAngleRight = Quaternion.AngleAxis(rayCastAngle, transform.right);
|
||||
|
||||
21
Assets/Scripts/Input/UseGroundChecking.cs
Normal file
21
Assets/Scripts/Input/UseGroundChecking.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Scampz.GameJam.Assets.Scripts
|
||||
{
|
||||
public class UseGroundChecking : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private bool useGroundChecking;
|
||||
|
||||
private void OnTriggerEnter(Collider collider)
|
||||
{
|
||||
if (collider.CompareTag("Player"))
|
||||
{
|
||||
var playerSpawnController = FindObjectOfType<PlayerSpawnController>();
|
||||
var player = playerSpawnController.Player;
|
||||
var rayCaster = player.GetComponent<RayCaster>();
|
||||
rayCaster.enabled = useGroundChecking;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Input/UseGroundChecking.cs.meta
Normal file
11
Assets/Scripts/Input/UseGroundChecking.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e569519f096090547aafb2a539705467
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user