Hello,
I’m trying to scale a card depending on how close it is to a character. The problem is that I have several different character objects grouped into a Family, and I want the card to scale based on the nearest character in that family.
However, I cannot find a Nearest function in Construct 3 that works like this.
Here is the code I tried:
Set Scale ---> max(0.2, min(2,
distance(Card.X, Card.Y,
Familie1.Nearest(Card.X,Card.Y).X,
Familie1.Nearest(Card.X,Card.Y).Y
) / 400))
My question is:
How can I calculate the distance from a card to the nearest object in a family, when there are multiple objects in that family?
Is there a recommended way to do this in Construct 3?
I’m still new to Construct 3, so any tips would really help.
Thanks a lot!
Thorsten