Hi all
I am wondering on an approach to grabbing and moving objects around in my test map (from a first person perspective, using the FPS Controller that comes with Unity). I’m on Unity Pro btw, not sure if that has anything to do with it.
I have made a cube that sits in front of the camera on the FPS Controller. It will later be replaced by either a 2d or 3d hand with a “open” and “closed/grab” state.
Use-case: I have made a door that sits in a frame. The door has a hinge joint attached, and has a min and max variable. Well, basically it behaves like a door you can open and close by walking into it. What I would like to do though is to click on the door, and while the button is down the camera freezes its movement and instead the mouse controls the movement of the door. That is, I would like to apply forces to the door so that it moves around but are still constrained by the hinge joint.
Use-case 2: I have an object on the ground. I would like to click on it, and since this item is movable the camera moves around like normal, but this time the object is attached to the hand. While attached, if the object has several joints (like one of my objects, a suitcase) I would still like it to be able to have physics applied to it, meaning if its a rope it will behave like a normal rope would, collisions and all.
In the second use-case I thought about maybe attaching the object/pickup to the hand object through parenting…? Not quite sure on how to attack this problem, so if anyone have some experience I would love to hear about it!