- Home /
2d Gui for Kinect Restrict in Z axis
I'm trying to have some buttons for a kinect hand to hit. I've made a sphere a child of the hand, made it RigidBody, turn on is Kinematic and it hits my buttons fine. However I'd like the sphere to remain at a z pos of 0 so it becomes more like a curser and hits wont depend on the z position of the hand I've tried this
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
Vector3 temp = transform.position;
temp.z = 0;
transform.position = temp;
}
}
But the sphere is not restricted in any axis, I've also tried restricting on the rigid body, but presumably because the body has a parent that doesnt work either. Any ideas of how I can achieve this?
sorry this is an update to my previous question, as it hadnt appeared I thought is lost, didnt read the moderation part! Sorry!
Your answer
Follow this Question
Related Questions
Custom Cursor with Kinect Wrapper 1 Answer
Change GUI element texture in C# when a boolean changes. 0 Answers
GameObject duplicates every time my GUI button is pressed 1 Answer
Use gui slider to change text field and vice versa? 1 Answer
Why can't I get my tooltip to show only when there is a tooltip set? 2 Answers