Hi, I am trying to create a interaction for my Rich ai using UUC and I want to use rotation on interaction. Can you help me create it or provide code that is available?
public override IEnumerator<CoroutineAction> Execute (IAstarAI ai) {
var dest = destination.position;
#if MODULE_ENTITIES
if (useRotation && ai is FollowerEntity follower) {
follower.SetDestination(dest, destination.rotation * Vector3.forward);
} else
#endif
{
if (useRotation) Debug.LogError("useRotation is only supported for FollowerEntity agents", ai as MonoBehaviour);
ai.destination = dest;
}
Hi there, would love to help here how I can- really quick can you tell me what you meant by ‘using UUC’? I am not familiar with the term and searches revealed nothing unfortunately.
sorry my bad, i meant to type UCC Opsive Ultimate Character Controller.
Oh okay, thank you for clarifying that. What’s the context for the rotation? While moving, just rotating on the spot, etc?
I found an example interactable.cs script in the AI * folder but it only rotates the ai on path reached to the interactable object when the ai is a followerEntity but I am using Rich ai as UCC only works with rich ai.
The RichAI doesn’t have an option to rotate to face a target built-in. But you can detect when it has reached its destination (ai.reachedDestination=true) and then rotate the agent manually using code.
1 Like