playMaker

Author Topic: Camera: Smooth Follow Action + Distance Damping?  (Read 159 times)

Thore

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
Camera: Smooth Follow Action + Distance Damping?
« on: September 17, 2017, 08:50:21 AM »
Hej,

I struggle somewhat to get a more advanced camera going, that needs to change how fast and loose it follows the player (I want this based on distance, but possibly also on other parameters). Smooth Follow Action works fine, but it always snaps into place.

I tried also the following: I created a game object, called Shadow which uses Position Smooth Damp. I get the distance to player, substract that from a value and feed this as the smooth time. In other words, the greater the distance, the faster it will follow. The shadow now follows the player in a rubberband-like manner. The further away you go, the faster it will try to catch up.

I set the camera to Smooth Follow Action, and another time also as a simple child (for the offset) of this Shadow object, rather than the player directly, which gets me somewhere near what I want. The problem is that this creates the typical Non-FixedUpdate jitter, in whatever variant I tried.

Maybe there are other ways to get what I want which is: divide the screen into three parts vertically, A|B|C. When the player is within B (the middle section), the camera is supposed to relax and move slowly. When the player moves towards either A or C (towards some threshold, A|B or B|C) the camera must speed up and basically lock onto the player as long as they run in this direction. Ideally, it's possible to "lock" into the player and release gradually by float.

If you have any idea how I can build this, or any pointer what I could try, I'd greatly appreciate it.
« Last Edit: September 17, 2017, 11:38:36 AM by Thore »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Camera: Smooth Follow Action + Distance Damping?
« Reply #1 on: October 16, 2017, 11:59:53 PM »
Hi,

 CineMachine would likely give you tremendous power without any code at all, have you experimented with it already?

 bye,

 Jean

Thore

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
Re: Camera: Smooth Follow Action + Distance Damping?
« Reply #2 on: October 17, 2017, 12:02:16 PM »
Didn’t know about it, looks fantastic (also that it is free now). I‘ll check it out. Thanks!