Silly me. Can anyone help me with small script? Here is me silly problem: We have an rigid item and a player. When player clicks on item, that item should stuck to players back ( Camera set behind the player ). You can move around and have that item on the back. Then player can click it again and that item unstuck from players and get physic properties "on" again. I will appreciated any help.
You need to add a gameobject and place it where you want the item to be on the back. When you press the button, use the Find function to find the object and attach one to the other. I'm guessing there is a detach function also, but I'm not sure.
Yeah i already got object on the back called "Backpack" special for that script. Right now i have some issues in moving one object to another and turning physics "off"... i'm such a noob -_-
I don't know how to change hierarchy trough script, and turning "rigid body" off, on a object. Anyone?
GameObject.transform.parent = transform; // this object is now a child of gameobject check here and here