PredeterminedMoveTowardsLocation property

Justin

Administrator
Staff member
It's a property, not a serialized field. Right now it can only be set via code. The reason for this is that the property is a single object but the MoveTowardsLocation returns an array so it's easiest to set via code to reduce confusion.
 

James

New member
re:"Right now it can only be set via code".. where in the code can I set this. I tried searching the entire solution but I can't seem to find anything.
 

Justin

Administrator
Staff member
It's on the cover ability. You can set it by doing something like:

Code:
var cover = ultimateCharacterLocomotion.GetAbility<Cover>();
cover.PredeterminedMoveTowardsLocation = yourLocation;
 

James

New member
and... "yourLocation" refers to what exactly? The location of the cover object or the location of the enemy object?
 

James

New member
I see this issue in Visual Studio, however, it compiles in Unity but shows an issue in Visual Studio 2019 Professional 16.9.3

1618070166406.png
 

James

New member
So, I seem to be back to square one here. I've tried the code snipped you posted but still no luck. I have a very small simple scene setup, two cover points, but the AI just ignores the cover positions no matter what I seem to try.

Will the AI use cover positions during combat phase?
 

Justin

Administrator
Staff member
The PredeterminedMoveTowardsLocation should point to the Transform that the MoveTowardsLocation component has been added to. The StartCover task uses this to tell the AI agent what cover position to take.

Code:
            m_Cover.PredeterminedMoveTowardsLocation = m_CoverPoint.Value.MoveTowardsLocation;
 
Top