Would there a way to have a function to have an object rotate towards multiple objects in a group?

Hi, I’ve been trying to create a function wherein a single object will be able to rotate towards multiple different object types, (about 20), based on the nearest one to the object.

Since I tried this in regular events, and it works, but is taxing on load times, I wanted to try creating a function that would maybe be able to just group the 20 objects and have the central object rotate towards them.

Is this at all possible? Thanks so much!

this may help in your question

1 Like

That’s referring to the group? It can be used just like that?:flushed:

yeah…? thats how its meant to be used? i think

Oh I see what you mean.

I meant, I have multiple objects with different names, that I want to group. Say, Enemy1, Enemy2, Enemy3. Etc.

So rather than it rotating towards each one individually in individual functions, if there was a way that it could rotate towards the group. Probably a long shot.

If you mean: “I want to have the player/object/etc rotate towards any object in the group”, then Spacesquid’s suggestion above will work.

If you mean: “I want to have the player/object/etc rotate towards whatever the most “middle” point of any object in the group”, you can still do that (within reason), but you’re going to have to do a lot of math.

Their method worked. I didn’t even know you could do that.


1 Like