I’m fairly new to c# and I’m trying to figure out how to make the objects which my character is holding able to interact with other objects. I just have some objects parented to my fps camera, and I want to make it so that if I were to slam an object into a wall, it wouldn’t clip through, but rather actually slam against it, and then if I were to look away, have that object rotate and transform back into it’s resting position. I’ve found that adding a rigidbody and disabling gravity works very well, but then my object has nothing to correct it’s position and it just wanders off into space.
make a reference transform, save the positions original location and rotation in it, then restore to the object when you want.