- Home /
How to attach an item to game object in game by touch?
I am new to unity and C sharp. I am wondering how can I detect if user's drag-drop action is succeed when user moves an item and placed it for the game character by touch (like moving a pair of glasses and placing it to a game character). Currently I have a box collider for the game character and "is trigger" is enabled. What I need is a way to detect when user moves that item and placed it in the correct position (Surrounded by my box collider), a success sound will be returned and then the system will disable any further drag & drop action. what functions do I need to get start? Any help would be appreciated.
Answer by Reeceg · Feb 03, 2015 at 11:51 AM
Have a boolean that tells you if your wearing something in that area and have a diffrent tag for everything so when sunglasses collides with face set the sunglasses's position to righting in front of the face the sunglasses and make the object a child of the player also make sure it has no rigid body or it wall fall.
Everything is working ok now and I made it a child of my main character but the child still be able to move. How can I prevent it from moving and behave like its parent, which is sit static.
Your answer

Follow this Question
Related Questions
is it possible to not get triggered by your own BoxCollider ? 3 Answers
How can I make a trigger detect Terrain? 0 Answers
Instantiating and deleting objects with triggers problem 0 Answers
How to check if a BoxCollider is hit by a trigger? 1 Answer
How to set vibrate/rumble on PS3 controller in Unity 5.1 0 Answers