Finished up improving static object colliders. Added network improvements to interactions, still half-baked.

This commit is contained in:
2025-11-08 21:52:54 +02:00
parent dddb082288
commit 50f758cc28
27 changed files with 4091 additions and 293 deletions

View File

@@ -1,12 +1,12 @@
using FishNet.Object;
using FMOD.Studio;
using System.Collections;
using System.Collections.Generic;
using Unity.XR.CoreUtils;
using UnityEngine;
using FMOD.Studio;
using static MouseLook;
public class CarDrivingRoutine : MonoBehaviour
public class CarDrivingRoutine : NetworkBehaviour
{
public AudioSource _stopSound;
public AudioSource _tireSound;
@@ -124,7 +124,7 @@ public class CarDrivingRoutine : MonoBehaviour
private void OnTriggerEnter(Collider other)
{;
if (other.GetComponent<XROrigin>() == null) return;
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
StartCoroutine(SmoothAdjustSpeed(0, 0, haltspeed)); // Smoothly halt in 1 second
_tireSound.Stop();
_stopSound.Play();
@@ -135,7 +135,7 @@ public class CarDrivingRoutine : MonoBehaviour
private void OnTriggerExit(Collider other)
{
if (other.GetComponent<XROrigin>() == null) return;
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
StartCoroutine(SmoothAdjustSpeed(targetSpeed, targetRotationSpeed, haltspeed)); // Smoothly resume speed in 1 second
_stopSound.Stop();
_tireSound.Play();