Instantly share code, notes, and snippets.

Embed
What would you like to do?
using UnityEngine;
public class AutoSyncTranformTest : MonoBehaviour
{
[SerializeField] BoxCollider target;
void Update()
{
RaycastHit hit;
target.transform.position = new Vector3(0, 0, 5);
Physics.Raycast(transform.position, new Vector3(0, 0, 10), out hit);
Debug.Log(hit.distance);
target.transform.position = new Vector3(0, 0, 10);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment