Support Forum

Using other Scripts inside AIDestinationSetter.cs

Hello guys. I am trying to use my Player.cs variables inside the AIDestinationSetter.cs but i cant really reach Player script. How to achieve that?

Hi

You cannot reach any scripts outside the pathfinding project from its scripts. I would advise you to use a custom script instead and remove the AIDestinationSetter component. You can instead set the ai.destination property directly (which is all the AIDestinationSetter component does). See https://arongranberg.com/astar/docs/iastarai.html#destination

Yeah, I defined an assemble and referenced, it semms like working. But your way is much more easier for me!