Is it possible to Implement [Use Rotation] for [Link2]?

  • A* version: 5.4.5
  • Unity version: 6000.0.23

Hi! :rofl:

Brief overview of the problem:

Is it possible to achieve an effect similar to the [UseRotation of AIDestinationSetter] in [Link2]? That is, to move along a smooth trajectory so that upon reaching the Start of [Link2], the entity is facing the End.:joy:

Detailed description of the problem:

I am using FollowerEntity in a Raycast map with OffmeshLink.

I am handling the OffmeshLink process with a custom jump animation, which works well overall.

However, since my jump animation is fixed-direction, I need to ensure the FollowerEntity is facing the correct direction before jumping. Using [Link2] doesn’t guarantee that the FollowerEntity’s direction will be roughly consistent with the Link’s direction when it reaches the starting point. Therefore, I need to perform a stationary turn after reaching the Start of [Link2].

The above processing works procedurally, but the final visual effect is unnatural. I still want to allow the FollowerEntity to smoothly adjust its orientation along the overall movement trajectory when moving towards the Start of [Link2].

I noticed that there’s a [UseRotation] configuration item in [AIDestinationSetter], and its trajectory behavior perfectly matches my needs. However, after reviewing the documentation, it doesn’t seem to mention being able to configure something similar for [Link2].

Thank you for your patience in reading! I would be extremely grateful for any help you may offer!:blush:

So you are able to just set the rotation manually, in good ol’ Update() and then set their rotation slowly towards the destination manually. You could even make it so the closer they are to the start of the NodeLink2 the more ā€œalignedā€ they are with some simple coding.

Alternatively you can disable how their rotation is coupled to the Transform altogether and control it manually when they are at/near the NodeLink2 with UpdateRotation

This is not possible at the moment, I’m afraid. But it’s something I have been considering.

It might be possible to hack it in by changing these two lines in JobControl.cs

facingDirectionAtEndOfPath = destination.facingDirection,
endOfPath = state.endOfPath,

to be the link’s start point and link’s facing direction, respectively, when approaching a link.