What I have is a camera that is attached to the player object so that the player turns and looks where the camera is looking. I want to create and object slightly in front of the character that will always be in front of them, but still allow the character to look around. I’ve create a book object and placed it just below the characters view so that to view the book they have to look down, but they can then look up and around. The problem that is occurring is that when the character turns the book stays where it is, essentially ending up behind the character instead of staying in front of them just below their normal vision. Making the book a child of the character solves this problem, but then it moves where the character looks instead of staying below their field of view. Any help is much appreciated and I will provide code if needed, thank you.
You should have everything under an Empty object, with a hierarchy like this:
- Player
-
- Player Mesh
-
- Camera
-
- Book
The movement script will happen under Player. In this way, rotation and position for all will be updated as the player elects to move. Looking around will affect the rotation and possibly offset of the camera, but only in relation to “Player” - not in relation to the game world.