A few days ago I was trying to make a filtering for nearby Tween animations, which excludes some unnecessary and out-of-range animations to play. However, while I was looking for functions to calcule the player distance, I don’t know which of those are the best way to do that.
Hi, before I write a code example, I want to make sure that I understand what you want to accomplish. You basically want to check if the player is in a specific area or at a specific distance before playing or stopping an animation, yes?
Unless you have a giant animation (lets say bigger than 100x100 studs) then you should be fine using the .Position property to filter based on the character distance. The reason is that you might have something too big (Like a space canon let’s say) where the primary part of the model is too far away from the actual canon. Since this space canon is big then the player might be right in between the cannon showing and the primary part not being close.