Question by
denielsenpaulus · Nov 28, 2018 at 05:34 AM ·
scripting problemintegrationgrabtriggering animation box collider3dobject
How do you grab object using perception neuron?
We are using Perception Neuron in Unity and managed to interact with 3D objects. We wanted to be able to pick up objects but only manage to use keyboard as the trigger. It`s really buggy and had a lot of problems such as not detecting fingers in the colliders, unable to remove the object after, etc. Can someone help us with this problem? I didnt receive proper training before so i dont really know much about unity and C# itself. Thanks in advance for your time!
edit: This is my current script
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class Grab : MonoBehaviour { public Transform Robot_RightHand; public Transform BallParent;
private void OnCollisionEnter(Collision collision)
{
if (collision.collider.CompareTag("Ball") && Input.GetKey("space"))
{
collision.transform.SetParent(Robot_RightHand);
}
else if (Input.GetKeyUp("n"))
{
collision.transform.SetParent(BallParent);
}
}
}
Comment