Skip to content

Instantly share code, notes, and snippets.

@CameronVetter
Created July 3, 2017 15:36
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 CameronVetter/133c9937771549b9d114dc77c2381793 to your computer and use it in GitHub Desktop.
Save CameronVetter/133c9937771549b9d114dc77c2381793 to your computer and use it in GitHub Desktop.
Make him Animate
using HoloToolkit.Unity.InputModule;
using UnityEngine;
public class Cowboy : MonoBehaviour, IInputClickHandler
{
private Animator _anim;
private void Start()
{
InputManager.Instance.AddGlobalListener(gameObject);
}
public void MoveCharacterToPoint(Vector3 newLoc)
{
if (_anim == null) _anim = gameObject.GetComponent<Animator>();
_anim.SetFloat("Forward", 1);
}
public void OnInputClicked(InputClickedEventData eventData)
{
MoveCharacterToPoint(GazeManager.Instance.HitPosition);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment