#How would I make this AI follow the closest player?

42 messages · Page 1 of 1 (latest)

wet shoal
#

I can help

marsh hollow
mint sun
marsh hollow
#

It’s the easiest way actually

uncut mauve
#

Do you need help to get the nearest player or do you need help to make it follow the nearest player

uncut mauve
#

Oh that’s because you’re using the local player chip

#

Use sphere overlap starting at the pos of the wither and set it to ignore objects

#

Then wire list get element 0 to the chip that turns collision data into player data(idr what it’s called but just search collision data)

#

I would have the 30hz go thru it before the if

plush haven
#

you want a synced player variable as the “closest player” and then you want to set that variable to the local player if the distance between the local player and the object is less than the distance between the player variable and the object

#

One sec ill try make a graph

uncut mauve
#

Yes

#

Yes both work

#

Overlap sphere might take a bit more cpu heat tho

#

Yes

plush haven
#

Something that goes around the lines of this

#

make sure the player variable is synced

#

no

#

use an event 30hz on the if

#

yes

#

make them the same variable and they will be automatically synced

#

also you will need an event reciever(player joined) and wire the exec of it to another player variable and wire the player on the event reciever to the player variable

#

so it sets

#

a default

#

person to compare

#

against

#

are you the only player in the room?

plush haven
#

its not comparing anything yet because there is nothing already in the player variable

#

do what i said above then rejoin the room and it will start working

#

thats correct

#

no problem if you have any promblems ping me

tawny shore
#

@mint sun i have an ai but it goes thro walls

tawny shore
#

No

#

Thats why it goes thro walls

tawny shore
#

Yes

#

And it jumpscares them

deep iron
uncut mauve
#

Do you have it wired so that it follows the player variable and not the local player?

plush haven
#

wire the player variable output