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.
asked Apr 28 '10 at 10:41 AM
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.
answered Apr 28 '10 at 11:33 AM
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!
answered Apr 28 '10 at 01:32 PM