Ι’ve been assigned a project in which a guide gives instructions orally or through text to the user regarding his position in an interior area.
So far, i have created the user’s avatar as a first person controller in which i have embedded a static (unanimated) character model which represents the guide. It holds a constant position on the right side of the avatar and moves with it. The problem is that even though i have added colliders both in the guide’s mesh(mesh collider) and in the avatar(rigid body) the quide still seems not to be materialised (passes through walls).
Where lies the problem? Do you think there is a better way to implement the whole project?
Thanks in advance.
Correct me if I’m wrong, but if you are parenting the guide to the player’s character model then it won’t matter what colliders you have on your guide because the physics calculations are taking place on the CharacterController of the player’s character object and moving the entire GameObject accordingly. If you want the guide to collide too then I can think of two ways of doing this:
1 - (Not recommended) Make the CharacterController large enough to encompass the guide so it will be included in the CharacterController’s calculations.
2 - Leave the guides as an independent GameObject but put a CharacterController/CharacterMotor on it. Then use then use your player’s CharacterController’s inputMoveDirection and assign it to the guide’s inputMoveDirection. You would also need to write code that will constantly monitor the guide’s position relative to the player’s model and move it as necessary to keep it in place.