Skip to main content
Participant
February 4, 2017

Pool stick - how to attach to both hands?

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

xlar54Author
Participant
February 4, 2017
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);
    }
}