Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created October 5, 2018 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/e05146779f6710e21bd5065d8bbcd1cf to your computer and use it in GitHub Desktop.
Save tsubaki/e05146779f6710e21bd5065d8bbcd1cf to your computer and use it in GitHub Desktop.
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