Hi.
If you can help with this logic to be done in Blueprint;
I have 5 objects of A in different locations, and one object of B. I need B to choose the nearest object to it ?
Thank you
Hi.
If you can help with this logic to be done in Blueprint;
I have 5 objects of A in different locations, and one object of B. I need B to choose the nearest object to it ?
Thank you
The second half of this video tutorial explains how to choose all objects of a specified class. - YouTube
In object B, create a variable which stores a reference to an object of the class A and a variable to store a distance. Then find the distance between objects for each object found of the class A. (how to execute a code for each object is shown in the video above) and check if it is smaller then what is stored in the distance variable. If it is smaller or previously stored reference to an object is invalid (i.e. it is the first object of the class A found), then update the object reference and a distance variables with current values. When this has been done for all objects, the object reference variable will be pointing to the closest object.
I hope this helps.