GeekeeGrl
GeekeeGrl

Reputation: 9

Unity 4 - Imported non-humanoid character with animations. Can I add physics?

I am relatively new to Unity and I need help on something I am doing for a contract. I have a non-humanoid PC imported with animations as an fbx file so I have to do the animations through legacy scripting as far as I have been able to discover. I have a third person camera attached to the player. I want it to have a lag, as though it were being dragged on a rope by the PC, so when it starts, stops, or accelerates, it will take some time to follow or catch up. I have only been able to accomplish anything close to this behavior through the use of physics, but that breaks the animations. Any tips on how I can go about solving this problem would be greatly appreciated.

Upvotes: 0

Views: 554

Answers (1)

Kay
Kay

Reputation: 13146

I guess the animation sometimes hits the camera.
I need this as well for my current propject and my plan is:

  1. Detach the camera from player
  2. No physics for the camera as far as you can afford it i.e. the environment is not too complicated and does not lead to situations where the PC is occluded because of obstacles between camera and character
  3. Move the camera in LateUpdate just by manipulating its transform and let it follow the current player position
  4. Use things like Vector3.SmoothDamp, Mathf.SmoothDamp, Slerp etc. to achieve the attenuation effect

Upvotes: 1

Related Questions