Interesting-exe / sponge-ai

Creates AI generated Spongebob episodes
50 stars 18 forks source link

Works amazingly but need resources for character movement #8

Closed PorkDevMode closed 1 year ago

PorkDevMode commented 1 year ago

I love this code but I was wondering if you could give me some idea / link of how to make the other characters face the character speaking when they are speaking.

Interesting-exe commented 1 year ago

i'd try creating a spherecast in the while statement at line 283 and making every character in the spherecast radius look at the speaker using Transform.LookAt. you can find the speaker using this: Transform speaker = GameObject.Find(d.character).transform;.

You could also create an array of all the characters and make them look at the speaker but i think only making the characters close to the speaker look at him makes more sense