OrientToTarget causing some fun camera movement

I guess this fits best under the Polish lecture so here goes.

When I’m using an ability and it uses the OrientToTarget effect, my camera jerks suddenly to compensate. The jitter goes away if I remove that effect from the ability. I’ve played with a ton of the settings but I’ve been kind of just pulling on levers and hoping something works with no success yet (some really sickening failures though).

I think it’s almost certainly to do with the fact I have zero dead zone. I wanted that 1:1 player to camera movement but I have a feeling what I’m doing or how I implemented it are the issue. Maybe something to do with the camera brain update timing?

Anyone have any ideas of a fix? Included a video and some of my camera settings


And this effect doesn’t happen when the player turns in other circumstances? For example, in Fighter.cs, we transform.LookAt(target.transform.position)

The camera is tracking the Transform.position, which shouldn’t be changing based on the change in rotation…
Let’s take a look at your OrientToTarget effect.

Yeah it’s jumpy in combat too. When you are being attacked but haven’t attacked them that turn-to-attack is the same jumpy effect. This instance was just front and center in my brain. :tired_face:

I don’t think my script strayed away from Sam’s.

public class OrientToTarget : EffectStrategy

    {

        public override void StartEffect(AbilityData data, Action finished)

        {

            data.GetUser().transform.LookAt(data.GetTargetedPoint());

            finished();

        }

    }

So that’s good and normal… I’m not sure why the camera is jumping…

This should be mitigated with a small dead zone adjustment.

1 Like

Yeah I’ll have to keep messing with it and see what I can do.

Thanks Brian

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms