cancel
Showing results for 
Search instead for 
Did you mean: 

Pool stick - how to attach to both hands?

xlar54
Honored Guest
Im using Touch controllers.  Id like to attach a pool stick to both hands, such that I can move hands around, but the stick will pivot and stay connected to the controllers.  Obviously i can connect it to one hand, but how would I attach to both?
1 REPLY 1

xlar54
Honored Guest
disregard.  what i did was place the stick outside of the hands, and attached this script to the stick.  Target is the left hand, and controller is set to right hand in the UI

using UnityEngine;
using System.Collections;

public class StickScript : MonoBehaviour {

    //values that will be set in the Inspector
    public Transform Target;
    public OVRInput.Controller Controller;
// Update is called once per frame
void Update () {

        transform.localPosition = OVRInput.GetLocalControllerPosition(Controller);
        transform.LookAt(Target);
    }
}