Updated to stop using deprecated set and get function for position and orientation of object