Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
754 B

namespace VRTK.Examples.Archery
{
using UnityEngine;
public class Follow : MonoBehaviour
{
public bool followPosition;
public bool followRotation;
public Transform target;
private void Update()
{
if (target != null)
{
if (followRotation)
{
transform.rotation = target.rotation;
}
if (followPosition)
{
transform.position = target.position;
}
}
else
{
VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.NOT_DEFINED, "target"));
}
}
}
}