Rotating FPC Causes Player To Pass Through Surfaces

Howdy all, I'm creating a game where at certain points the First Person Controller is animated to tip forwards and backwards, this creates an odd tilting camera effect as the player changes direction to give the feeling their guy is leaning through injury.

I've done this by animating a cube to tip and made it a parent object of my FPC (maybe an odd way of doing it but it was the only way I could get it so the FPC would still function correctly).

My problem is that as this happens the FPC will pass through the floor or wall if the player is very close to one.

Is there a method such as altering the FPC, change my animation technique etc that would stop this from happening. (Note: I can't just turn gravity off as there are points where my the character will fall).

Any ideas will be greatly appreciated. Many thanks, Will.

Having a CharacterController as a child to something else that moves is never a good idea since the physics engine won't be able to detect the collisions.

I suggest you find another approach - for example you could animate only the camera to get the tilting effect you want, while you leave the game object with the CharacterController alone.

Thanks for the input Rune but tilting the camera wouldn't achieve the effect that I was after.

I ended up simply animating the cube to lift up and move in the opposite direction of each tilt. Now no matter how the player is moving they won't breach the floor or a wall. Thankfully it works a treat.

Many thanks, Will.

P.S Great work on the Locomotion system, I will no doubt use it one day!