#How would I make this AI follow the closest player?
42 messages · Page 1 of 1 (latest)
Today I show you how to use rec rooms premade skeletons (or any NPC) to make your own monster for your rooms. This is beta content using Circuits including the spawner gadget and the respawn chip. #recroom #vr #tutorial
Use Code RCL1 To Support Me on Rec Room or CLick Here https://rec.net/?a=RCL1
LIKE and SUBSCRIBE!!!
Thanks Neko - https://www....
too buggy
It’s the easiest way actually
Do you need help to get the nearest player or do you need help to make it follow the nearest player
That doesn’t follow the nearest player
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
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
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?
and also make sure you do this
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
@mint sun i have an ai but it goes thro walls
this is gonna sound stupid but whered you make this?
Do you have it wired so that it follows the player variable and not the local player?
wire the player variable output